摘要: 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. You may complet... 阅读全文
posted @ 2014-11-25 12:54 LiBlog 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for t... 阅读全文
posted @ 2014-11-25 11:56 LiBlog 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.You shoul... 阅读全文
posted @ 2014-11-25 10:51 LiBlog 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have t... 阅读全文
posted @ 2014-11-25 10:11 LiBlog 阅读(111) 评论(0) 推荐(0) 编辑