摘要: Insert IntervalGiven a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals... 阅读全文
posted @ 2015-01-09 16:30 H5开发技术 阅读(134) 评论(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-01-08 20:25 H5开发技术 阅读(116) 评论(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-01-07 23:29 H5开发技术 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Merge IntervalsGiven a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18]... 阅读全文
posted @ 2015-01-07 21:56 H5开发技术 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Regular Expression MatchingImplement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more o... 阅读全文
posted @ 2015-01-07 21:18 H5开发技术 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Maximum SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−... 阅读全文
posted @ 2015-01-05 20:08 H5开发技术 阅读(194) 评论(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-01-05 15:13 H5开发技术 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Unique Paths IITotal Accepted:22828Total Submissions:81414My SubmissionsFollow up for "Unique Paths":Now consider if some obstacles are added to the g... 阅读全文
posted @ 2015-01-05 14:27 H5开发技术 阅读(163) 评论(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-01-04 22:56 H5开发技术 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Remove Duplicates from Sorted Array IIFollow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =... 阅读全文
posted @ 2015-01-04 21:13 H5开发技术 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 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 ... 阅读全文
posted @ 2015-01-04 20:39 H5开发技术 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Populating Next Right Pointers in Each NodeGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLi... 阅读全文
posted @ 2015-01-04 18:53 H5开发技术 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Longest Valid ParenthesesGiven a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substr... 阅读全文
posted @ 2015-01-03 21:04 H5开发技术 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2015-01-03 19:31 H5开发技术 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Integer to RomanGiven an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.罗马数字的组数规则,有几条须注意掌握;(1)基本数字Ⅰ、... 阅读全文
posted @ 2015-01-03 17:11 H5开发技术 阅读(165) 评论(0) 推荐(0) 编辑
摘要: First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Yo... 阅读全文
posted @ 2015-01-03 16:35 H5开发技术 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Edit DistanceGiven two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You... 阅读全文
posted @ 2015-01-03 16:06 H5开发技术 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Container With Most WaterGivennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such t... 阅读全文
posted @ 2015-01-03 15:05 H5开发技术 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Reverse Linked List IIReverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return... 阅读全文
posted @ 2015-01-03 12:19 H5开发技术 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Path Sum IIGiven a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tr... 阅读全文
posted @ 2015-01-03 11:37 H5开发技术 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the be... 阅读全文
posted @ 2015-01-03 11:20 H5开发技术 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Restore IP AddressesGiven a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"255255... 阅读全文
posted @ 2015-01-03 10:52 H5开发技术 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Binary Search Tree IteratorImplement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callin... 阅读全文
posted @ 2015-01-01 16:40 H5开发技术 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Palindrome Partitioning IIGiven a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a p... 阅读全文
posted @ 2015-01-01 15:17 H5开发技术 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Best Time to Buy and Sell Stock IIISay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the... 阅读全文
posted @ 2014-12-30 21:53 H5开发技术 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Best Time to Buy and Sell Stock IISay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the ... 阅读全文
posted @ 2014-12-30 20:52 H5开发技术 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4... 阅读全文
posted @ 2014-12-30 20:26 H5开发技术 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Factorial Trailing ZeroesGiven an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.统计末尾... 阅读全文
posted @ 2014-12-30 16:52 H5开发技术 阅读(469) 评论(2) 推荐(0) 编辑
摘要: Simplify PathGiven an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"click to sh... 阅读全文
posted @ 2014-12-29 21:24 H5开发技术 阅读(226) 评论(0) 推荐(0) 编辑
摘要: Generate ParenthesesGivennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a sol... 阅读全文
posted @ 2014-12-29 21:23 H5开发技术 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sum... 阅读全文
posted @ 2014-12-29 21:22 H5开发技术 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Combination SumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thes... 阅读全文
posted @ 2014-12-29 21:20 H5开发技术 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Subsets IIGiven a collection of integers that might contain duplicates,S, return all possible subsets.Note:Elements in a subset must be in non-descend... 阅读全文
posted @ 2014-12-29 21:19 H5开发技术 阅读(162) 评论(0) 推荐(0) 编辑
摘要: SubsetsGiven 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... 阅读全文
posted @ 2014-12-29 21:18 H5开发技术 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit ... 阅读全文
posted @ 2014-12-29 21:17 H5开发技术 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there... 阅读全文
posted @ 2014-12-28 22:45 H5开发技术 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 4SumGiven an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum... 阅读全文
posted @ 2014-12-28 20:03 H5开发技术 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 3SumGiven an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:El... 阅读全文
posted @ 2014-12-28 19:36 H5开发技术 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Excel Sheet Column NumberRelated to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column ... 阅读全文
posted @ 2014-12-28 19:01 H5开发技术 阅读(236) 评论(0) 推荐(0) 编辑
摘要: Palindrome PartitioningGiven a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioni... 阅读全文
posted @ 2014-12-27 22:53 H5开发技术 阅读(145) 评论(0) 推荐(0) 编辑