-
-
-
-
-
Given a collection of intervals, merge all overlapping intervals.
For example,
Given[1,3],[2,6],[8,10],[15,18],
return[1,6],[8,10],[15,18]. ...
阅读题目
面试题
经典指数
-
-
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
For example,
Given[100, 4, 200, 1, 3, 2],
The longest consecutive elements sequence is[1, 2, 3, 4]. Return its length:4.
Your algorithm should run in O(n) complexity. ...
阅读题目
面试题
经典指数
-
Follow up for "Remove Duplicates":
What if duplicates are allowed at most twice?
For example,
Given sorted array A =[1,1,1,2,2,3],
Your function should return length =5, and A is now[1,1,2,2,3]. ...
阅读题目
面试题
经典指数
-
-
在一个长度为n的整形数组a里,除了三个数字只出现一次外,其他的数字都出现了2次。请写程序输出任意一个只出现一次的数字,程序时间和空间复杂度越小越好。
例如:a = {1,3,7,9,5,9,4,3,6,1,7},输出4或5或6
C/C++:
void find(int* a , int n);
Java:
void find(int[] a); ...
阅读题目
问答题
经典指数
扫描后移动端查看
相关标签
同类标签
|
微信公众号
|
|
欢迎加入,一起群聊
|