
poketGems
文章平均质量分 63
jialuyyy
这个作者很懒,什么都没留下…
展开
-
Ternary Expression
Ternary Expression a?b:c a / \b ca?b?c:d:e a / \ b e / \c da?b:c?d:e a / \ b c / \ d einput: String exproutput: Expression原创 2015-06-20 23:48:11 · 289 阅读 · 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 · 207 阅读 · 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 · 194 阅读 · 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 · 262 阅读 · 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 · 309 阅读 · 0 评论