摘要: Description: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit.... 阅读全文
posted @ 2015-09-11 03:49 影湛 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Description: Find the number Weak Connected Component in the directed graph. Each node in the graph contains a label and a list of its neighbors. (a ... 阅读全文
posted @ 2015-09-11 01:50 影湛 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Description: Given string A representative a positive integer which has N digits, remove any k digits of the number, the remaining digits are arrange... 阅读全文
posted @ 2015-09-10 21:59 影湛 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Description: Given two 32 bit numbers, N and M, and two bit positions, i and j. Write a method to set all bits between i and j in N equal to M (e g ,... 阅读全文
posted @ 2015-09-10 04:41 影湛 阅读(218) 评论(1) 推荐(0) 编辑
摘要: Description: Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn... 阅读全文
posted @ 2015-09-10 03:01 影湛 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Description: The structure of Expression Tree is a binary tree to evaluate certain expressions. All leaves of the Expression Tree have an number stri... 阅读全文
posted @ 2015-09-09 20:52 影湛 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Description: Find the kth smallest number in at row and column sorted matrix. Example, Given k = 4 and a matrix: [ [1 ,5 ,7], [3 ,7 ,8], [4 ,8 ,... 阅读全文
posted @ 2015-09-09 16:03 影湛 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Description: Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example, [1,1,2] have the fol... 阅读全文
posted @ 2015-08-29 05:02 影湛 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Description: Given a string s and a dictionary of words dict, determine if s can be break into a space separated sequence of one or more dictionary w... 阅读全文
posted @ 2015-08-28 21:06 影湛 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Description: After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much att... 阅读全文
posted @ 2015-08-28 20:28 影湛 阅读(83) 评论(0) 推荐(0) 编辑