leetcode
文章平均质量分 76
icomputational
这个作者很懒,什么都没留下…
展开
-
First Missing Positive
leetcode First Missing Positive原创 2014-06-07 21:49:16 · 589 阅读 · 0 评论 -
3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c)原创 2014-03-22 12:05:51 · 410 阅读 · 0 评论 -
Binary Tree Preorder Traversal
Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3].Note: Recursive solution is tr原创 2014-03-21 22:45:47 · 345 阅读 · 0 评论 -
Search in Rotated Sorted Array
Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the array return it原创 2014-03-21 22:33:34 · 359 阅读 · 0 评论 -
Wildcard Matching
leetcode,动态规划,字符串匹配原创 2014-04-02 23:47:46 · 568 阅读 · 0 评论 -
Binary Tree Maximum Path Sum
leetcode, 二叉树, Binary Tree Maximum Path Sum原创 2014-04-01 23:26:48 · 850 阅读 · 0 评论 -
Reorder List
Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given {1,2,3,4}, reorder it to {1,4原创 2014-03-20 22:26:59 · 351 阅读 · 0 评论 -
Decode Ways
leetcode,Decode Ways, 动态规划原创 2014-03-31 23:26:34 · 509 阅读 · 0 评论 -
Subsets II
leetcode, Subsets II原创 2014-05-01 21:41:48 · 500 阅读 · 0 评论 -
Jump Game
leetcode, Jump Game , 递推求解原创 2014-05-01 23:21:32 · 506 阅读 · 0 评论 -
Convert Sorted List to Binary Search Tree
leetcode, 递归, Convert Sorted List to Binary Search Tree 的两种解法原创 2014-03-19 23:29:53 · 580 阅读 · 0 评论 -
Maximal Rectangle
leetcode, Maximal Rectangle, 直方图面积计算的O(N)算法,垂线法原创 2014-03-30 19:28:23 · 607 阅读 · 0 评论 -
Insertion Sort List
leetcode, insort sort list 的两种解法原创 2014-03-30 16:08:43 · 514 阅读 · 0 评论 -
Binary Tree Preorder Traversal
leetcode, Binary Tree Preorder Traversal , 两种非递归解法, Morris 遍历讲解原创 2014-03-29 23:25:29 · 564 阅读 · 0 评论 -
Edit Distance
leetcode, Edit distance, 最优的O(N)额外空间实现原创 2014-03-28 22:32:00 · 475 阅读 · 0 评论 -
Sort Colors
leetcode,三色排序原创 2014-04-29 23:35:55 · 706 阅读 · 0 评论 -
Word Search
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 "adjacent" cells are those horizontally or vertically n原创 2014-05-04 23:32:22 · 380 阅读 · 0 评论 -
Palindrome Number
leetcode, palindrome number原创 2014-04-19 19:46:11 · 563 阅读 · 0 评论 -
Pascal's Triangle II
Pascal's Triangle II, leetcode,两个解法原创 2014-06-06 23:37:03 · 620 阅读 · 0 评论 -
Letter Combinations of a Phone Number
Letter Combinations of a Phone Number, leetcode原创 2014-04-27 17:35:31 · 821 阅读 · 0 评论 -
Regular Expression Matching
leetcode, Regular Expression Matching原创 2014-04-27 20:58:47 · 559 阅读 · 0 评论 -
String to Integer (atoi)
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input case原创 2014-04-25 21:26:54 · 427 阅读 · 0 评论 -
Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.class Solution {public: int reverse(int x) {原创 2014-04-25 21:22:46 · 392 阅读 · 0 评论 -
Same Tree
leetcode, Same Tree判定原创 2014-04-25 20:26:35 · 638 阅读 · 0 评论 -
Simplify Path
leetcode, simplify path原创 2014-04-10 22:44:36 · 692 阅读 · 0 评论 -
Gray Code
Gray code 生成的两种解法, leetcode原创 2014-04-08 23:56:34 · 524 阅读 · 0 评论 -
Combinations
combination 的6种解法原创 2014-05-08 00:40:30 · 725 阅读 · 0 评论 -
Plus One
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.用carri原创 2014-03-26 22:30:46 · 389 阅读 · 0 评论 -
Permutation Sequence
leetcode , Permutation Sequence, 递推原创 2014-04-05 00:19:41 · 661 阅读 · 0 评论 -
Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree and sum原创 2014-03-24 23:00:20 · 362 阅读 · 0 评论 -
Copy List with Random Pointer
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 of the list.原创 2014-04-05 13:49:56 · 396 阅读 · 0 评论 -
Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For原创 2014-04-20 22:20:13 · 341 阅读 · 0 评论 -
Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = "great": great / \ gr原创 2014-04-03 22:57:49 · 620 阅读 · 0 评论 -
Minimum Path Sum
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or right at a原创 2014-03-17 19:56:18 · 389 阅读 · 0 评论 -
Longest Valid Parentheses
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()", wh原创 2014-03-28 00:06:10 · 603 阅读 · 0 评论 -
Gas Station
leetcode, Gas Station原创 2014-03-10 22:56:44 · 484 阅读 · 0 评论 -
Distinct Subsequences
leetcode , 动态规划, Distinct Subsequences原创 2014-03-05 00:36:28 · 792 阅读 · 0 评论 -
Palindrome Partitioning
leetcode, Palindrome Partitioning , 动态规划 + DFS原创 2014-03-10 23:46:49 · 627 阅读 · 0 评论 -
Median of Two Sorted Arrays
leetcode, Median of two Sorted Array, MIT algorithm原创 2014-03-11 00:41:57 · 656 阅读 · 0 评论 -
Word Break
leet code, words break, 动态规划,F(n) = (F(i) && s.substr( i, n - i)) --- i in range [0, n].原创 2014-03-03 22:48:14 · 548 阅读 · 0 评论