poketGems
文章平均质量分 63
jialuyyy
这个作者很懒,什么都没留下…
展开
-
Ternary Expression
Ternary Expression a?b:c a / \ b c a?b?c:d:e a / \ b e / \ c d a?b:c?d:e a / \ b c / \ d e input: String expr output: Expression原创 2015-06-20 23:48:11 · 278 阅读 · 0 评论 -
Implement strStr()
Implement strStr() Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Update (2014-11-02): The signatur原创 2015-06-04 21:55:47 · 191 阅读 · 0 评论 -
Maximum Product Subarray
Maximum Product Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguou原创 2015-06-05 02:25:45 · 188 阅读 · 0 评论 -
Find k most repeating elements
Given a list and a number k, print out the top k most repeating elements in the list. 1. Use hashmap to store the pair of number and count. 2. Use priority queue to store the hash node based on原创 2015-06-05 02:15:25 · 257 阅读 · 0 评论 -
sliding window
A long array A[] is given to you. There is a sliding window of size w which is moving from the very left of the array to the very right. You can only see the w numbers in the window. Each time the转载 2015-06-05 06:14:50 · 297 阅读 · 0 评论