摘要:
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... 阅读全文
摘要:
Set Matrix ZeroesGiven a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did yo... 阅读全文
摘要:
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... 阅读全文
摘要:
Word Break IIGiven a string s and a dictionary of words dict, add spaces in s toconstruct a sentence where each word is a valid dictionaryword.Return ... 阅读全文
摘要:
Clone GraphClone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes ar... 阅读全文
摘要:
Iterative vs. Recursive ApproachesEyal Lantzman, 5 Nov 2007 CPOLIntroductionThis article was originally posted at blogs.microsoft.co.il/blogs/Eyal.Re... 阅读全文
摘要:
Maximum Product SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given... 阅读全文
摘要:
Populating Next Right Pointers in Each Node IIFollow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any ... 阅读全文
摘要:
Populating Next Right Pointers in Each Node TotalGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next... 阅读全文
摘要:
Word SearchGiven 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, wh... 阅读全文