Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have
exact...
分类:
其他好文 时间:
2015-02-03 09:33:14
阅读次数:
96
Given an array of size n, find the majority element. Themajority element is the element that appears more than ? n/2
? times.
You may assume that the array is non-empty and the majority element alwa...
分类:
编程语言 时间:
2015-02-02 23:15:34
阅读次数:
255
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 equal to m + n) to hold additional elements from B....
分类:
其他好文 时间:
2015-02-02 23:12:19
阅读次数:
171
Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character'.'.You may assume that there will be on...
分类:
其他好文 时间:
2015-02-02 22:49:09
阅读次数:
234
【题目】
Compare two version numbers version1 and version1.
If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0.
You may assume that the version strings are non-em...
分类:
其他好文 时间:
2015-02-02 21:32:15
阅读次数:
102
使用王爽著的《汇编语言》开始自己的汇编之旅,遇到一些疑惑,记录下来,看以后会不会解惑。 1 assume cs:codesg,ds:datasg 2 datasg segment 3 db 'ibm ' 4 db 'dec ' 5 db 'dos ...
分类:
其他好文 时间:
2015-02-02 17:19:35
阅读次数:
147
题目如下
Given an array of size n, find the majority element. The majority element is the element that appears more than ?
n/2 ? times.
You may assume that the array is non-empty and the majority...
分类:
其他好文 时间:
2015-02-01 16:08:38
阅读次数:
202
Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially...
分类:
其他好文 时间:
2015-02-01 07:05:19
阅读次数:
191
【题目】
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 ...
分类:
其他好文 时间:
2015-01-31 17:54:53
阅读次数:
203
Given a sorted array and a target value, return the index if the target isfound. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array.
H...
分类:
其他好文 时间:
2015-01-31 12:51:27
阅读次数:
98