<commit_before>My LeetCode solutions
=========

This repo contains my solutions to the problems of [LeetCode](http://oj.leetcode.com/), an online judge platform for preparing technical coding interviews.
The problem statements can be found [here](http://oj.leetcode.com/problems/).
All the solutions are written in Java.

Organization
------------

The solutions to a given problem are put in a separate folder bearing the same name as that problem.
For most of the problems, there is a single solution in a file named `Solution.java`.
For some problems, there exist multiple solutions in files `Solution_<method>.java`, where `<method>` is a descriptive keyword to distinguish different approaches.

Some problems use custom structs.
The definitions of these structs as classes are originally given in the code template as comments at the top.
I removed them to keep my codes cleaner.
(I seldom put comments in my code unless truly necessary)
Instead, I put all the definition classes in the folder `util/`.
This also makes it easier for local debugging.

Contributions
----------------

Some of my solutions may not be optimal in either memory or time efficiency.
If you have found a better solution to any problems, you are welcome to post your solution by making a pull request.
I will merge it into the repo with full attribution once I have them reviewed.

Problem Status
--------------

The below table lists the current status for each problem.

Total: 149, Solved: 149

|Problem|Status|
|-------|------|
|Max Points on a Line|Accepted|
|Sort List|Accepted|
|Insertion Sort List|Accepted|
|LRU Cache|Accepted|
|Binary Tree Postorder Traversal|Accepted|
|Binary Tree Preorder Traversal|Accepted|
|Reorder List|Accepted|
|Linked List Cycle II|Accepted|
|Linked List Cycle|Accepted|
|Word Break II|Accepted|
|Word Break|Accepted|
|Copy List with Random Pointer|Accepted|
|Single Number II|Accepted|
|Single Number|Accepted|
|Candy|Accepted|
|Gas Station|Accepted|
|Clone Graph|Accepted|
|Palindrome Partitioning II|Accepted|
|Palindrome Partitioning|Accepted|
|Surrounded Regions|Accepted|
|Sum Root to Leaf Numbers|Accepted|
|Longest Consecutive Sequence|Accepted|
|Word Ladder II|Accepted|
|Word Ladder|Accepted|
|Valid Palindrome|Accepted|
|Binary Tree Maximum Path Sum|Accepted|
|Best Time to Buy and Sell Stock III|Accepted|
|Best Time to Buy and Sell Stock II|Accepted|
|Best Time to Buy and Sell Stock|Accepted|
|Triangle|Accepted|
|Pascal's Triangle II|Accepted|
|Pascal's Triangle|Accepted|
|Populating Next Right Pointers in Each Node II|Accepted|
|Populating Next Right Pointers in Each Node|Accepted|
|Distinct Subsequences|Accepted|
|Flatten Binary Tree to Linked List|Accepted|
|Path Sum II|Accepted|
|Path Sum|Accepted|
|Minimum Depth of Binary Tree|Accepted|
|Balanced Binary Tree|Accepted|
|Convert Sorted List to Binary Search Tree|Accepted|
|Convert Sorted Array to Binary Search Tree|Accepted|
|Binary Tree Level Order Traversal II|Accepted|
|Construct Binary Tree from Inorder and Postorder Traversal|Accepted|
|Construct Binary Tree from Preorder and Inorder Traversal|Accepted|
|Maximum Depth of Binary Tree|Accepted|
|Binary Tree Zigzag Level Order Traversal|Accepted|
|Binary Tree Level Order Traversal|Accepted|
|Symmetric Tree|Accepted|
|Same Tree|Accepted|
|Recover Binary Search Tree|Accepted|
|Validate Binary Search Tree|Accepted|
|Interleaving String|Accepted|
|Unique Binary Search Trees II|Accepted|
|Unique Binary Search Trees|Accepted|
|Binary Tree Inorder Traversal|Accepted|
|Restore IP Addresses|Accepted|
|Reverse Linked List II|Accepted|
|Subsets II|Accepted|
|Decode Ways|Accepted|
|Gray Code|Accepted|
|Merge Sorted Array|Accepted|
|Scramble String|Accepted|
|Partition List|Accepted|
|Maximal Rectangle|Accepted|
|Largest Rectangle in Histogram|Accepted|
|Remove Duplicates from Sorted List II|Accepted|
|Remove Duplicates from Sorted List|Accepted|
|Search in Rotated Sorted Array II|Accepted|
|Remove Duplicates from Sorted Array II|Accepted|
|Word Search|Accepted|
|Subsets|Accepted|
|Combinations|Accepted|
|Minimum Window Substring|Accepted|
|Sort Colors|Accepted|
|Search a 2D Matrix|Accepted|
|Set Matrix Zeroes|Accepted|
|Edit Distance|Accepted|
|Simplify Path|Accepted|
|Climbing Stairs|Accepted|
|Sqrt(x)|Accepted|
|Text Justification|Accepted|
|Plus One|Accepted|
|Valid Number|Accepted|
|Add Binary|Accepted|
|Merge Two Sorted Lists|Accepted|
|Minimum Path Sum|Accepted|
|Unique Paths II|Accepted|
|Unique Paths|Accepted|
|Rotate List|Accepted|
|Permutation Sequence|Accepted|
|Spiral Matrix II|Accepted|
|Length of Last Word|Accepted|
|Insert Interval|Accepted|
|Merge Intervals|Accepted|
|Jump Game|Accepted|
|Spiral Matrix|Accepted|
|Maximum Subarray|Accepted|
|N-Queens II|Accepted|
|N-Queens|Accepted|
|Pow(x, n)|Accepted|
|Anagrams|Accepted|
|Rotate Image|Accepted|
|Permutations II|Accepted|
|Permutations|Accepted|
|Jump Game II|Accepted|
|Wildcard Matching|Accepted|
|Multiply Strings|Accepted|
|Trapping Rain Water|Accepted|
|First Missing Positive|Accepted|
|Combination Sum II|Accepted|
|Combination Sum|Accepted|
|Count and Say|Accepted|
|Sudoku Solver|Accepted|
|Valid Sudoku|Accepted|
|Search Insert Position|Accepted|
|Search for a Range|Accepted|
|Search in Rotated Sorted Array|Accepted|
|Longest Valid Parentheses|Accepted|
|Next Permutation|Accepted|
|Substring with Concatenation of All Words|Accepted|
|Divide Two Integers|Accepted|
|Implement strStr()|Accepted|
|Remove Element|Accepted|
|Remove Duplicates from Sorted Array|Accepted|
|Reverse Nodes in k-Group|Accepted|
|Swap Nodes in Pairs|Accepted|
|Merge k Sorted Lists|Accepted|
|Generate Parentheses|Accepted|
|Valid Parentheses|Accepted|
|Remove Nth Node From End of List|Accepted|
|Letter Combinations of a Phone Number|Accepted|
|4Sum|Accepted|
|3Sum Closest|Accepted|
|3Sum|Accepted|
|Longest Common Prefix|Accepted|
|Roman to Integer|Accepted|
|Integer to Roman|Accepted|
|Container With Most Water|Accepted|
|Regular Expression Matching|Accepted|
|Palindrome Number|Accepted|
|String to Integer (atoi)|Accepted|
|Reverse Integer|Accepted|
|ZigZag Conversion|Accepted|
|Longest Palindromic Substring|Accepted|
|Add Two Numbers|Accepted|
|Longest Substring Without Repeating Characters|Accepted|
|Median of Two Sorted Arrays|Accepted|
|Two Sum|Accepted|

<commit_msg>Moved "Problem Status" into wiki page<commit_after>My LeetCode solutions
=========

This repo contains my solutions to the problems of [LeetCode](http://oj.leetcode.com/), an online judge platform for preparing technical coding interviews.
The problem statements can be found [here](http://oj.leetcode.com/problems/).
All the solutions are written in Java.

Organization
------------

The solutions to a given problem are put in a separate folder bearing the same name as that problem.
For most of the problems, there is a single solution in a file named `Solution.java`.
For some problems, there exist multiple solutions in files `Solution_<method>.java`, where `<method>` is a descriptive keyword to distinguish different approaches.

Some problems use custom structs.
The definitions of these structs as classes are originally given in the code template as comments at the top.
I removed them to keep my codes cleaner.
(I seldom put comments in my code unless truly necessary)
Instead, I put all the definition classes in the folder `util/`.
This also makes it easier for local debugging.

Contributions
----------------

Some of my solutions may not be optimal in either memory or time efficiency.
If you have found a better solution to any problems, you are welcome to post your solution by making a pull request.
I will merge it into the repo with full attribution once I have them reviewed.

Problem Status
--------------

Total: 149, Solved: 149

See this [wiki page](../../wiki/Problem-Status) to view status for each problem.
{'fraction_non_alphanumeric': 0.0925312261024726, 'fraction_numerical': 0.002039255671679837, 'mean_word_length': 5.993761140819965, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2383236', 'n_tokens_mistral': 2408, 'n_tokens_neox': 2294, 'n_words': 927}