- 博客(63)
- 资源 (1)
- 收藏
- 关注
原创 Partition List
Partition List Total Accepted: 4859 Total Submissions: 18717My SubmissionsGiven a linked list and a value x, partition it such that all nodes less than x come before nodes greater than o
2014-02-01 03:20:31 351
原创 Merge Sorted Array
Merge Sorted Array Total Accepted: 6782 Total Submissions: 21148My SubmissionsGiven two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A h
2014-02-01 02:53:42 435
原创 Gray Code
Gray Code Total Accepted: 4541 Total Submissions: 14545My SubmissionsThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative in
2014-01-31 11:31:01 398
原创 Decode Ways
Decode Ways Total Accepted: 4316 Total Submissions: 28200My SubmissionsA message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2
2014-01-31 11:24:08 386
原创 Subsets II
Subsets II Total Accepted: 4686 Total Submissions: 17623My SubmissionsGiven a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements i
2014-01-31 11:05:51 409
原创 Reverse Linked List II
Reverse Linked List II Total Accepted: 4937 Total Submissions: 19604My SubmissionsReverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3
2014-01-31 05:34:24 429
原创 Restore IP Addresses
Restore IP Addresses Total Accepted: 3846 Total Submissions: 19574My SubmissionsGiven a string containing only digits, restore it by returning all possible valid IP address combinations.
2014-01-31 05:13:19 386
原创 Binary Tree Inorder Traversal
Binary Tree Inorder Traversal Total Accepted: 8234 Total Submissions: 24173My SubmissionsGiven a binary tree, return the inorder traversal of its nodes' values.For example:Given bina
2014-01-31 04:46:35 396
原创 Unique Binary Search Trees
Unique Binary Search Trees Total Accepted: 6702 Total Submissions: 18812My SubmissionsGiven n, how many structurally unique BST's (binary search trees) that store values 1...n?For exam
2014-01-30 10:06:39 487
原创 Interleaving String
Interleaving String Total Accepted: 4089 Total Submissions: 22357My SubmissionsGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "
2014-01-30 09:39:18 449
原创 Validate Binary Search Tree
Validate Binary Search Tree Total Accepted: 6009 Total Submissions: 23796My SubmissionsGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined
2014-01-30 06:56:21 409
原创 Recover Binary Search Tree
Recover Binary Search Tree Total Accepted: 4188 Total Submissions: 19186My SubmissionsTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changin
2014-01-30 06:47:01 384
原创 Same Tree
Same Tree Total Accepted: 8118 Total Submissions: 19053My SubmissionsGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if
2014-01-30 06:08:29 419
原创 Symmetric Tree
Symmetric Tree Total Accepted: 7304 Total Submissions: 22577My SubmissionsGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, thi
2014-01-30 06:03:28 376
原创 Binary Tree Level Order Traversal
Binary Tree Level Order Traversal Total Accepted: 6147 Total Submissions: 20353My SubmissionsGiven a binary tree, return the level order traversal of its nodes' values. (ie, from left to
2014-01-30 05:48:36 368
原创 Binary Tree Zigzag Level Order Traversal
Binary Tree Zigzag Level Order Traversal Total Accepted: 4281 Total Submissions: 16488My SubmissionsGiven a binary tree, return the zigzag level order traversal of its nodes' values. (ie
2014-01-30 05:35:47 358
原创 Maximum Depth of Binary Tree
Maximum Depth of Binary Tree Total Accepted: 8605 Total Submissions: 19098My SubmissionsGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the l
2014-01-30 05:25:18 326
原创 Construct Binary Tree from Preorder and Inorder Traversal
Construct Binary Tree from Preorder and Inorder Traversal Total Accepted: 4148 Total Submissions: 16533My SubmissionsGiven preorder and inorder traversal of a tree, construct the binary
2014-01-30 05:19:12 460
原创 Construct Binary Tree from Inorder and Postorder Traversal
Construct Binary Tree from Inorder and Postorder Traversal Total Accepted: 3984 Total Submissions: 15858My SubmissionsGiven inorder and postorder traversal of a tree, construct the binar
2014-01-30 04:46:27 490
原创 Binary Tree Level Order Traversal II
Binary Tree Level Order Traversal II Total Accepted: 4998 Total Submissions: 16087My SubmissionsGiven a binary tree, return the bottom-up level order traversal of its nodes' values. (ie,
2014-01-30 04:24:32 410
原创 Convert Sorted Array to Binary Search Tree
Convert Sorted Array to Binary Search Tree Total Accepted: 5997 Total Submissions: 18635My SubmissionsGiven an array where elements are sorted in ascending order, convert it to a height
2014-01-30 04:08:45 367
原创 Convert Sorted List to Binary Search Tree
Convert Sorted List to Binary Search Tree Total Accepted: 5229 Total Submissions: 19480My SubmissionsGiven a singly linked list where elements are sorted in ascending order, conv
2014-01-30 03:59:53 369
原创 Balanced Binary Tree
Balanced Binary Tree Total Accepted: 6933 Total Submissions: 21938My SubmissionsGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree
2014-01-30 03:13:30 382
原创 Minimum Depth of Binary Tree
Minimum Depth of Binary Tree Total Accepted: 6481 Total Submissions: 22608My SubmissionsGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the s
2014-01-30 02:35:59 419
原创 Word Ladder II
Word Ladder II Total Accepted: 1864 Total Submissions: 22064My Submissions Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start
2014-01-30 01:41:25 577 1
原创 Path Sum II
Path Sum II Total Accepted: 4675 Total Submissions: 17435My Submissions Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For ex
2014-01-29 12:21:51 334
原创 Path Sum
Path Sum Total Accepted: 6233 Total Submissions: 20973My SubmissionsGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along
2014-01-29 12:20:39 320
原创 Flatten Binary Tree to Linked List
Flatten Binary Tree to Linked List Total Accepted: 5986 Total Submissions: 22817My SubmissionsGiven a binary tree, flatten it to a linked list in-place.For example,Given 1
2014-01-29 10:05:27 367
原创 Distinct Subsequences
Distinct Subsequences Total Accepted: 4132 Total Submissions: 17739My SubmissionsGiven a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a
2014-01-29 09:22:13 396
原创 Populating Next Right Pointers in Each Node II
Populating Next Right Pointers in Each Node II Total Accepted: 4052 Total Submissions: 14122My Submissions Follow up for problem "Populating Next Right Pointers in Each Node".Wha
2014-01-29 08:47:59 351
原创 Populating Next Right Pointers in Each Node
Populating Next Right Pointers in Each Node Total Accepted: 5874 Total Submissions: 17154My Submissions Given a binary tree struct TreeLinkNode { TreeLinkNode *left;
2014-01-29 08:46:45 346
原创 Pascal's Triangle II
Pascal's Triangle II Total Accepted: 4756 Total Submissions: 16191My SubmissionsGiven an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1
2014-01-29 04:45:23 328
原创 Pascal's Triangle
Pascal's Triangle Total Accepted: 5534 Total Submissions: 17449My SubmissionsGiven numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[
2014-01-29 04:20:11 349
原创 Triangle
Triangle Total Accepted: 3987 Total Submissions: 15556My Submissions Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the
2014-01-29 04:19:16 348
原创 Best Time to Buy and Sell Stock III
Best Time to Buy and Sell Stock III Total Accepted: 4172 Total Submissions: 19287My SubmissionsSay you have an array for which the ith element is the price of a given stock on day i.De
2014-01-29 03:05:37 565
原创 Best Time to Buy and Sell Stock II
Best Time to Buy and Sell Stock II Total Accepted: 6524 Total Submissions: 18350My SubmissionsSay you have an array for which the ith element is the price of a given stock on day i.Des
2014-01-29 02:38:07 533
原创 Best Time to Buy and Sell Stock
Best Time to Buy and Sell Stock Total Accepted: 6696 Total Submissions: 21484My SubmissionsSay you have an array for which the ith element is the price of a given stock on day i.If you
2014-01-29 02:30:37 572
原创 Binary Tree Maximum Path Sum
Binary Tree Maximum Path Sum Total Accepted: 5229 Total Submissions: 27600My SubmissionsGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tre
2014-01-29 02:14:44 476
原创 Valid Palindrome
Valid Palindrome Total Accepted: 5552 Total Submissions: 25824My SubmissionsGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
2014-01-29 01:48:58 309
原创 Word Ladder
Word Ladder Total Accepted: 4645 Total Submissions: 28613My SubmissionsGiven two words (start and end), and a dictionary, find the length of shortest transformation sequence from start t
2014-01-28 10:32:04 630
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人