摘要: Find Peak ElementA peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and ... 阅读全文
posted @ 2015-09-09 23:16 Sean_le 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tre... 阅读全文
posted @ 2015-09-09 23:01 Sean_le 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Spiral Matrix IIGiven an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the... 阅读全文
posted @ 2015-09-09 22:39 Sean_le 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Spiral MatrixGiven a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[... 阅读全文
posted @ 2015-09-09 22:31 Sean_le 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Rotate ImageYou are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?每次转换四个点... 阅读全文
posted @ 2015-09-09 21:20 Sean_le 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Minimum Path SumGiven amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along ... 阅读全文
posted @ 2015-09-09 19:47 Sean_le 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Generate ParenthesesGivennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a sol... 阅读全文
posted @ 2015-09-09 18:37 Sean_le 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Gray CodeThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the tot... 阅读全文
posted @ 2015-09-09 17:29 Sean_le 阅读(831) 评论(0) 推荐(0) 编辑
摘要: Unique PathsA 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 a... 阅读全文
posted @ 2015-09-09 16:45 Sean_le 阅读(92) 评论(0) 推荐(0) 编辑