随笔分类 -  LeetCode

(heap)239. Sliding Window Maximum
摘要:题目:Given an arraynums, there is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can only see theknumbe... 阅读全文

posted @ 2015-07-26 16:43 银杉 阅读(162) 评论(0) 推荐(0)

(Stack)Basic Calculator I && II
摘要:Basic Calculator IImplement a basic calculator to evaluate a simple expression string.The expression string may contain open(and closing parentheses),... 阅读全文

posted @ 2015-07-03 09:49 银杉 阅读(234) 评论(0) 推荐(0)

Best Time to Buy and Sell Stock III
摘要:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文

posted @ 2015-06-30 15:18 银杉 阅读(147) 评论(0) 推荐(0)

(greedy)Best Time to Buy and Sell Stock II
摘要:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文

posted @ 2015-06-30 12:06 银杉 阅读(178) 评论(0) 推荐(0)

(Data structure)Implement Trie && Add and Search Word
摘要:Implement Trie (Prefix Tree)Implement a trie withinsert,search, andstartsWithmethods.Note:You may assume that all inputs are consist of lowercase lett... 阅读全文

posted @ 2015-06-29 21:56 银杉 阅读(279) 评论(0) 推荐(0)

(DP)Best Time to Buy and Sell Stock
摘要:题目:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction ... 阅读全文

posted @ 2015-05-15 17:20 银杉 阅读(256) 评论(0) 推荐(0)

(DP)House Robber
摘要:题目:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping... 阅读全文

posted @ 2015-05-07 13:39 银杉 阅读(172) 评论(0) 推荐(0)

导航