摘要: Reconstruct Original Digits from English Given a non-empty string containing an out-of-order English representation of digits 0-9, output the digits i 阅读全文
posted @ 2017-04-10 16:28 Eason Liu 阅读(365) 评论(0) 推荐(0) 编辑
摘要: Coin ChangeYou are given coins of different denominations and a total amount of moneyamount. Write a function to compute the fewest number of coins th... 阅读全文
posted @ 2015-12-28 13:39 Eason Liu 阅读(2016) 评论(0) 推荐(0) 编辑
摘要: Range Sum Query - ImmutableGiven an integer arraynums, find the sum of the elements between indicesiandj(i≤j), inclusive.Example:Given nums = [-2, 0, ... 阅读全文
posted @ 2015-11-16 18:59 Eason Liu 阅读(2274) 评论(0) 推荐(0) 编辑
摘要: Longest Increasing SubsequenceGiven an unsorted array of integers, find the length of longest increasing subsequence.For example,Given[10, 9, 2, 5, 3,... 阅读全文
posted @ 2015-11-04 13:30 Eason Liu 阅读(344) 评论(0) 推荐(0) 编辑
摘要: Bulls and CowsYou are playing the followingBulls and Cowsgame with your friend: You write a 4-digit secret number and ask your friend to guess it, eac... 阅读全文
posted @ 2015-10-31 21:55 Eason Liu 阅读(1990) 评论(0) 推荐(0) 编辑
摘要: Serialize and Deserialize Binary TreeSerialization is the process of converting a data structure or object into a sequence of bits so that it can be s... 阅读全文
posted @ 2015-10-29 17:54 Eason Liu 阅读(552) 评论(0) 推荐(0) 编辑
摘要: Find Median from Data StreamMedian is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the m... 阅读全文
posted @ 2015-10-20 22:23 Eason Liu 阅读(622) 评论(0) 推荐(0) 编辑
摘要: Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.... 阅读全文
posted @ 2015-10-19 19:49 Eason Liu 阅读(283) 评论(0) 推荐(0) 编辑
摘要: Nim GameYou are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 t... 阅读全文
posted @ 2015-10-13 14:28 Eason Liu 阅读(443) 评论(0) 推荐(0) 编辑
摘要: Word PatternGiven apatternand a stringstr, find ifstrfollows the same pattern.Examples:pattern ="abba", str ="dog cat cat dog"should return true.patte... 阅读全文
posted @ 2015-10-06 10:54 Eason Liu 阅读(1655) 评论(0) 推荐(0) 编辑