- 博客(8)
- 资源 (4)
- 收藏
- 关注
原创 [LeetCode] Count and Say
The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read
2013-08-28 13:04:50 1032
原创 [leetCode] Construct Binary Tree from Preorder and Inorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. class Solution { public: TreeNode *buildTree(vector
2013-08-27 07:59:52 790
原创 [LeetCode] Plus one
class Solution { public: vector plusOne(vector &digits) { // Start typing your C/C++ solution below // DO NOT write int main() function int size=digits.size(); vect
2013-08-26 12:16:53 789
原创 [LeetCode] Minimum Window Substring
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = "ADOBECODEBANC" T = "ABC" Minimum window is "BANC"
2013-08-26 00:20:19 4215
原创 [leetCode] Sort Colors
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integer
2013-08-25 23:13:16 760
原创 [LeetCode] Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2], [3,4], [
2013-08-24 03:06:21 989
原创 [LeetCode] Convert linked list to BST
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ /** * Definition for binary tree * stru
2013-08-22 12:59:56 589
原创 [LeetCode] 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 "()",
2013-08-11 00:05:49 2336
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人