随笔分类 -  leetcode题解

摘要:题目连接https://leetcode.com/problems/longest-valid-parentheses/Longest Valid ParenthesesDescriptionGiven a string containing just the characters ‘(’ and ... 阅读全文
posted @ 2015-12-11 20:47 GadyPu 阅读(170) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/valid-sudoku/Valid SudokuDescriptionDetermine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudo... 阅读全文
posted @ 2015-12-11 20:44 GadyPu 阅读(182) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/sudoku-solver/Sudoku SolverDescriptionWrite a program to solve a Sudoku puzzle by filling the empty cells.Empty cell... 阅读全文
posted @ 2015-12-11 20:39 GadyPu 阅读(174) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/count-and-say/Count and SayDescriptionThe count-and-say sequence is the sequence of integers beginning as follows:1,... 阅读全文
posted @ 2015-12-11 20:34 GadyPu 阅读(181) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/multiply-strings/Multiply StringsDescriptionGiven two numbers represented as strings, return multiplication of the n... 阅读全文
posted @ 2015-12-11 20:26 GadyPu 阅读(175) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/anagrams/Group AnagramsDescriptionGiven an array of strings, group anagrams together.For example, given: [“eat”, “te... 阅读全文
posted @ 2015-12-11 20:21 GadyPu 阅读(238) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/spiral-matrix/Spiral MatrixDescriptionGiven a matrix of m x n elements (m rows, n columns), return all elements of t... 阅读全文
posted @ 2015-12-11 20:15 GadyPu 阅读(129) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/length-of-last-word/Length of Last WordDescriptionGiven a string s consists of upper/lower-case alphabets and empty ... 阅读全文
posted @ 2015-12-11 20:12 GadyPu 阅读(207) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/plus-one/Plus OneDescriptionGiven a non-negative number represented as an array of digits, plus one to the number.Th... 阅读全文
posted @ 2015-12-09 20:44 GadyPu 阅读(217) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/add-binary/Add BinaryDescriptionGiven two binary strings, return their sum (also a binary string).For example,a = “1... 阅读全文
posted @ 2015-12-09 20:42 GadyPu 阅读(202) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/search-a-2d-matrix/Search a 2D MatrixDescriptionWrite an efficient algorithm that searches for a value in an m x n m... 阅读全文
posted @ 2015-12-09 20:40 GadyPu 阅读(156) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/word-search/Word SearchDescriptionGiven a 2D board and a word, find if the word exists in the grid.The word can be c... 阅读全文
posted @ 2015-12-09 20:37 GadyPu 阅读(193) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/path-sum/Path Sum/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; *... 阅读全文
posted @ 2015-12-09 20:33 GadyPu 阅读(170) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/path-sum-ii/Path Sum II/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *l... 阅读全文
posted @ 2015-12-09 20:31 GadyPu 阅读(201) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/flatten-binary-tree-to-linked-list/Flatten Binary Tree to Linked ListDescription/** * Definition for a binary tree n... 阅读全文
posted @ 2015-12-09 20:29 GadyPu 阅读(141) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/pascals-triangle/Pascal's TriangleDescriptionGiven numRows, generate the first numRows of Pascal’s triangle.For exam... 阅读全文
posted @ 2015-12-09 20:26 GadyPu 阅读(152) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/triangle/TriangleDescriptionGiven a triangle, find the minimum path sum from top to bottom. Each step you may move t... 阅读全文
posted @ 2015-12-09 20:24 GadyPu 阅读(154) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/valid-palindrome/Valid PalindromeDescriptionGiven a string, determine if it is a palindrome, considering only alphan... 阅读全文
posted @ 2015-12-09 20:20 GadyPu 阅读(178) 评论(0) 推荐(0)
摘要:题目连接 https://leetcode.com/problems/word-ladder/ Word Ladder Description Given two words (beginWord and endWord), and a dictionary’s word list, find th 阅读全文
posted @ 2015-12-09 20:17 GadyPu 阅读(162) 评论(0) 推荐(0)
摘要:题目连接https://leetcode.com/problems/longest-consecutive-sequence/Longest Consecutive SequenceDescriptionGiven an unsorted array of integers, find the le... 阅读全文
posted @ 2015-12-09 20:15 GadyPu 阅读(167) 评论(0) 推荐(0)