题目:
Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.You may assume no duplicate exists in the array....
分类:
其他好文 时间:
2015-03-30 11:22:35
阅读次数:
99
7151. 1758!
Constraints
Time Limit: 1 secs, Memory Limit: 256 MB
Description
1758 is coming! Some boys want to find
their dancing partners. For convenience, you may assume the squa...
分类:
其他好文 时间:
2015-03-30 09:16:52
阅读次数:
122
How would you print just the 10th line of a file?For example, assume that file.txt has the following content:Line 1Line 2Line 3Line 4Line 5Line 6Line ...
分类:
其他好文 时间:
2015-03-29 14:57:51
阅读次数:
88
Compare Version Numbers
Compare two version numbers version1 and version2.
If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0.
You may assume that the version...
分类:
其他好文 时间:
2015-03-29 13:42:43
阅读次数:
130
题目:Given an array of sizen, find the majority element. The majority element is the element that appears more than? n/2 ?times.You may assume that the ...
分类:
其他好文 时间:
2015-03-28 15:38:32
阅读次数:
129
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
You may assume that the intervals were initially sorted according to their start times.
Examp...
分类:
其他好文 时间:
2015-03-28 14:27:39
阅读次数:
144
Given a text file file.txt, transpose its content.You may assume that each row has the same number of columns and each field is separated by the ' ' c...
分类:
其他好文 时间:
2015-03-28 11:23:49
阅读次数:
126
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2015-03-22 00:18:36
阅读次数:
134
Same with Jump Game I. Just need a step parameter and assume there is no "0" value in the array. 1 class Solution { 2 public: 3 int jump(int A[], ...
分类:
其他好文 时间:
2015-03-20 06:55:43
阅读次数:
124
Given two sorted integer arrays A and B, merge B into A as one sorted array. Note:You may assume that A has enough space (size that is greater or equa...
分类:
其他好文 时间:
2015-03-19 20:21:20
阅读次数:
116