A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point ...
分类:
其他好文 时间:
2015-10-04 19:33:36
阅读次数:
143
Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace...
分类:
其他好文 时间:
2015-10-04 17:14:57
阅读次数:
294
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.Follow up: Did you use extra space?A straight forward sol...
分类:
其他好文 时间:
2015-10-04 17:14:04
阅读次数:
176
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes are labeled u...
分类:
其他好文 时间:
2015-10-04 17:11:43
阅读次数:
239
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted fr...
分类:
其他好文 时间:
2015-10-04 17:10:18
阅读次数:
132
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ...
分类:
其他好文 时间:
2015-10-04 17:10:15
阅读次数:
140
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,...
分类:
其他好文 时间:
2015-10-04 17:10:04
阅读次数:
165
Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded ...
分类:
其他好文 时间:
2015-10-04 17:09:19
阅读次数:
121
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 followin...
分类:
其他好文 时间:
2015-10-04 17:03:59
阅读次数:
106
Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,...
分类:
其他好文 时间:
2015-10-04 15:52:13
阅读次数:
244