Fetching latest commit…
Cannot retrieve the latest commit at this time.
Solution set for Leetcode online interview problems. (88/92) http://www.leetcode.com/onlinejudge My purpose of publishing the solution set is 1) preparing for the technical interviews; 2) looking forward better ideas and more elegant code to solve the problem. 3 Sum: medium 3 Sum Closest: medium 4 Sum: Is there a solution that the time complexity is better than O(n^2 * lgn)? Add Binary: medium Add Two Numbers: easy Anagrams: easy Climbing Stairs: medium Combination Sum: Is there a better way to construct the path? Combination Sum II: Is ther a better way to construct the path? Combinations: easy Container With Most Water: hard Count and Say: easy Decode Ways: dp Divide Two Integers: easy Edit Distance: dp First Missing Positive: easy Generate Parentheses: easy Gray Code: bit operation Implement strStr(): easy Insert Interval: easy Integer to Roman: easy Jump Game: medium Jump Game II: medium Largest Rectangle in Histogram: hard Length of Last Word: easy Letter Combinations of a Phone Number: easy Longest Common Prefix: easy ***Longest Palindromic Substring: hard Longest Substring Without Repeating Characters: easy Longest Valid Parentheses: medium Maximal Rectangle: hard Maximum Subarray: dp ***Median of Two Sorted Arrays Merge Intervals: easy Merge k Sorted Lists: medium Merge Sorted Array: medium Merge Two Sorted Lists: easy Minimum Path Sum: easy Minimum Window Substring: hard Multiply Strings: easy N-Queens: easy N-Queens II: dfs Next Permutation: hard Palindrome Number: Is there any better solution? Partition List: medium linked list Permutation Sequence: medium number theory Permutations: easy ***Permutations II: better solution than O(n! * lg(n!))? Plus One: easy Pow(x, n): medium how to write neat exponential steps Regular Expression Matching: hard, boundry and logic. Better solution? Remove Duplicates from Sorted Array: easy Remove Duplicates from Sorted Array II: easy Remove Duplicates from Sorted List: easy Remove Duplicates from Sorted List II: medium Remove Element: easy Remove Nth Node From End of List: medium Reverse Integer: easy Reverse Linked List II: medium Reverse Nodes in k-Group: medium Roman to Integer: easy Rotate Image: easy Rotate List: easy Scramble String: medium Search a 2D Matrix: binary search, easy Search for a Range: variant of binary search, easy Search in Rotated Sorted Array: variant of binary search, medium Search in Rotated Sorted Array II: variant of binary search, easy Search Insert Position: variant of binary search, easy Set Matrix Zeroes: easy Simplify Path: meidum Sort Colors: hard Spiral Matrix: easy Spiral Matrix II: easy Sqrt(x): variant of binary search, medium String to Integer (atoi): boring Subsets: easy ***Subsets II: similar as problem Permutations II Substring with Concatenation of All Words: hash, medium Sudoku Solver: easy dfs Swap Nodes in Pairs: linked list, easy Text Justification: easy ***Trapping Rain Water: don't understand the problem Two Sum: easy hash Unique Paths: easy Unique Paths II: easy Valid Number: boring Valid Parentheses: easy Valid Sudoku: easy Wildcard Matching: same as Regular Expression Matching Word Search: easy dfs ZigZag Conversion: easy AFTER 10/24/2012 NEW ADDED Interleaving String: easy dp Convert Sorted List To Binary Search Tree: easy Flatten Binary Tree to Linked List: medium