摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit. 阅读全文
posted @ 2013-01-25 16:00 cradle 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree. 阅读全文
posted @ 2013-01-25 15:39 cradle 阅读(649) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. 阅读全文
posted @ 2013-01-25 15:36 cradle 阅读(2272) 评论(0) 推荐(0) 编辑