题目:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't ...
分类:
其他好文 时间:
2014-10-26 00:20:26
阅读次数:
259
自己的几个list常用用法。mylist = [i for i in range(10)]mylist.pop(-1)mylist.append(9)mylist_1 = [i for i in range(10,20)]mylist_2 = zip(mylist, mylist_1)mylist....
分类:
数据库 时间:
2014-10-25 11:44:29
阅读次数:
213
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 ...
分类:
其他好文 时间:
2014-10-24 23:30:05
阅读次数:
260
题目:
Given a set of distinct integers, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets....
分类:
其他好文 时间:
2014-10-24 22:17:14
阅读次数:
198
Spiral Matrix IIGiven an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should retu...
分类:
其他好文 时间:
2014-10-24 12:35:31
阅读次数:
259
Spiral MatrixGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following m...
分类:
其他好文 时间:
2014-10-23 19:03:17
阅读次数:
272
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
For example,
Given the following matrix:
[
[ 1, 2, 3 ],
[ 4, 5, 6 ],
[ 7, 8, 9 ]
]
You...
分类:
其他好文 时间:
2014-10-23 12:36:01
阅读次数:
176
Given an integer n, generate a square matrix filled with elements from 1 to n2 in
spiral order.
For example,
Given n = 3,
You should return the following matrix:
[
[ 1, 2, 3 ],
[ 8, 9, 4 ],
[...
分类:
其他好文 时间:
2014-10-23 12:31:39
阅读次数:
132
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
For example,
Given the following matrix:
[
[ 1, 2, 3 ],
[ 4, 5, 6 ],
[ 7, 8, 9 ]
]
...
分类:
其他好文 时间:
2014-10-23 00:11:12
阅读次数:
157
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 1 /** 2 * Definition for singly-linked ....
分类:
其他好文 时间:
2014-10-21 03:33:45
阅读次数:
168