
Divide and Conquer
文章平均质量分 79
dyllanzhou
这个作者很懒,什么都没留下…
展开
-
[Leetcode]Kth Largest Element in an Array
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For example, Given [3,2,1,5,6,4] and k = 2, return 5. N原创 2015-08-27 15:37:54 · 255 阅读 · 0 评论 -
[Leetcode]Different Ways to Add Parentheses
Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *. Example 1 I原创 2015-10-22 18:53:10 · 243 阅读 · 0 评论 -
[Leetcode]Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the contiguous subarray [4,−1,2,1] has原创 2015-09-22 15:40:47 · 268 阅读 · 0 评论 -
[Leetcode]Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit string原创 2015-10-27 21:34:48 · 346 阅读 · 0 评论 -
[Leetcode]Count of Smaller Numbers After Self
You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smaller elements to the right of nums[i]. Example: G原创 2016-01-20 18:08:32 · 1060 阅读 · 0 评论 -
[Leetcode]Power of Three
Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using any loop / recursion? Credits: Special thanks to @dietpepsi for adding this pr原创 2016-06-23 11:14:00 · 273 阅读 · 0 评论