title
描述
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 no...
分类:
其他好文 时间:
2014-10-09 03:14:48
阅读次数:
163
问题描述:
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place
...
分类:
其他好文 时间:
2014-10-09 02:58:47
阅读次数:
175
这道题真真是在面试中碰到过,可惜当时复杂度到O(n2)了,太挫了,怪不得没有通过面试。
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two en...
分类:
编程语言 时间:
2014-10-09 01:58:17
阅读次数:
229
题目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your al...
分类:
其他好文 时间:
2014-10-09 00:31:07
阅读次数:
234
1.1.1 Remove Duplicates from Sorted Array题目:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the ...
分类:
其他好文 时间:
2014-10-08 14:20:45
阅读次数:
229
[leetcode]There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n))....
分类:
其他好文 时间:
2014-10-08 14:00:15
阅读次数:
147
DescriptionD Anti-Rhyme Pairs Input: Standard Input Output: Standard Output Often two words that rhyme also end in the same sequence of characters. We...
分类:
其他好文 时间:
2014-10-08 11:01:35
阅读次数:
261
[leetcode]Given an array where elements are sorted in ascending order, convert it to a height balanced BST....
分类:
其他好文 时间:
2014-10-08 10:09:55
阅读次数:
164
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have t...
分类:
其他好文 时间:
2014-10-08 07:40:24
阅读次数:
228
Remove Duplicates from Sorted ListGiven a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, r...
分类:
其他好文 时间:
2014-10-08 01:26:44
阅读次数:
239