Tyler's leetcode respository.
Here is the question list: (Difficulty Distribution: 1-5 Hard)
-
- Two Sum (2)
-
- Add Two Numbers (3)
-
- Logest String Without Repeating Characters (3)
-
- Median of Two Sorted Arrays (5) *
-
- Longest Palindromic Substring (3) (Brute force, Dynamic Programming)
-
- ZigZag Conversion (3)
-
- Reverse Integer (2)
-
- String to Integer (2)
-
- Palidrome Number (2) (Reverse, Generic)
-
- Regular Expression Matching (5) (Recursive)
-
- Container With Most Water (2)
-
- Integer To Roman (1) (StringBuffer)
-
- Roman To Integer (1)
-
- Longest Common Prefix (1)
-
- 3Sum (2)
-
- 3Sum Closest (2)
-
- Letter Combinations of a Phone Number (1)
-
- 4Sum => kSum (3)
-
- Remove Nth Node From End of List (2) corner case
-
- Valid Parentheses (1)
-
- Merge Two Sorted Lists (1)
-
- Generate Parenthesis (2)
-
- Merge K sorted Lists (2) (merge sort, priority queue, my priority queue)
-
- Swap Nodes in Paris (1)
-
- Reverse Nodes In K-Group (2)
-
- Remove Duplicates Form Sorted Arrays (1)
-
- Remove Element (1)
-
- Implement strStr() (3) (Brute Force, KMP)
-
- Divide Two Integers (4) (Corner case)
-
- Substring with Concatenation of All Words (4) Failed
-
- Next Permutation (2)
-
- Longest Valid Parentheses (3)
-
- Search in Rotated Sorted Array (2)
-
- Search For a Range (2)
-
- Search Insert Position (2)
-
- Valid Suduko (2)
-
- Sudoku Solver (3)
-
- Count and Say (1)
-
- Combination Sum (1)
-
- Combination SumII (1)
-
- First Missing Positive (1)
-
- Trapping Rain Water (3)
-
- Multiply Strings (3) ** failed
-
- Wildcard Matching (5) * failed
-
- Jump GameII (2)
-
- Permutation (2) (recursive, iterative)
-
- PermutationII (2)
-
- Rotate Image(2)
-
- Anagrams (2)
-
- Pow(x, n) (3)
-
- N-Queens (4) (Recursive, Iterative) failed
-
- N-QueensII (4) (Recursive, Iterative)
-
- Maximun SubArray (3) (Divide and Conquer, Linear Solution) ** failed
-
- Spiral Matrix (2)
-
- Jump Game (2)
-
- Merge Intervals (4) *
-
- Insert Interval (4) *
-
- Length of Last Word(1)
-
- Sprial MatrixII (2)
-
- Permutation Sequence (3) * failed
-
- Rotate List (1)
-
- Unique Paths (1)
-
- Unique PathsII (1)
-
- Minimum Path Sum (1)
-
- Valid Number (5) (DFA) *
-
- Plus One (1)
-
- Add Binary (1)
-
- Text Justification (2)
-
- Sqrt() (2)
-
- Climbing Stairs (1)
-
- Simplify Path (3)
-
- Edit Distance (5) * got it
-
- Set Matrix Zeros (1)
-
- Search a 2D Matrix (3) * (lgn solution)
-
- Sort Colors (2)
-
- Minimum Window Substring (5)
-
- Combinations (2)
-
- Subsets (1)
-
- Word Search (3)
-
- Remove Duplicates From Sorted ArrayII (1)
-
- Search In Rotated Sorted ArrayII (2)
-
- Remove Duplicates From Sorted ListII (1)
-
- Remove Duplicates From Sorted List (1)
-
- Largest Rectangle in Histogram (5) * Failed
-
- Maximal Rectangle (5) * Failed
-
- Partition List (1)
-
- Scramble String (5) * (Memorization Algorithm, Dynamic Programming) Failed
-
- Merge Sorted Array (1)
-
- Gray Code (2) * Subtle
-
- SubsetsII (2)
-
- Decode Ways (3) * DP
-
- Reverse Linked ListII (1)
-
- Restore IP Addresses (2)
-
- Binary Tree Inorder Traversal (2) (Stack, Morris Traversal)
-
- Unique Binary Search TreesII (3)
-
- Unique Binary Search Trees (2)
-
- Interleaving String (4) * (Dynamic Programming)
-
- Validate Binary Search Tree (2)
-
- Recover Binary Search Tree (4) * (Stack, Morris Traversal)
-
- Same Tree (2)
-
- Symmetric Tree (2)
-
- Binary Tree Level Order Traversal (3)
-
- Binary Tree Zigzag Level Order Traversal (3)
-
- Maximum Depth of Binary Tree (2)
-
- Construct Binary Tree from Preorder and Inorder Traversal (3) (Recursive, Iterative)
-
- Construct Binary Tree from Inorder and Postorder Traversal (3) (Recursive, Iterative)
-
- Binary Tree Level Order TraversalII (2)
-
- Convert Sorted Array to Binary Search Tree (2)
-
- Convert Sorted List to Binary Search Tree (3) *
-
- Balanced Binary Tree (3)
-
- Minimum Depth of Binary Tree (3)
-
- Path Sum (1)
-
- Path SumII (4)
-
- Flatten Binary Tree To Linked List (4)
-
- Distinct Subsequences (5) * (Dynamic Programming) Failed
-
- Populating Next Right Pointers in Each Node (4)
-
- Populating Next Right Pointers in Each Node (5) *
-
- Pascal's Triangle (1)
-
- Pascal's TriangleII (2)
-
- Triangle (4)
-
- Best Time to Buy and Sell Stock (2) (Dynamic Programming)
-
- Best Time to Buy and Sell StockII (3) (Greedy)
-
- Best Time to Buy and Sell StockIII (4) (Dynamic Programming) *
-
- Binary Tree Maximum Path Sum (5)
-
- Valid Palidrome (2)
-
- Word LadderII (5) *
-
- Word Ladder (4) *
-
- Longest Consecutive Sequence (3)
-
- Sum Root to Leaf Numbers (2)
-
- Surrounded Regions (4)
-
- Palindrome Partitioning (2)
-
- Palindrome Partitioning (5) (Dynamic Programming) *
-
- Clone Graph (2)
-
- Gas Station (3)
-
- Candy (5) *
-
- Single Number (2)
-
- Single NumberII (5) *
-
- Copy List with Random Pointer (3)
-
- Word Break (4) *
-
- Word BreakII (4) *
-
- Linked List Cycle (3)
-
- Linked List CycleII (5) *
-
- Reordre List (3)
-
- Binary Tree Preorder Traversal (1)
-
- Binary Tree Postorder Traversal (3) (Morris Traversal) *
-
- LUR Cache (4) *
-
- Insertion Sort List (2)
-
- Sort List (5) (Paper) *
-
- Max Points on a Line (3)
-
- Evaluate Reverse Polish Notation (2)
-
- Reverse Words in a String (2)
-
- Maximum Product Subarray (3) (Dynamic Programming) *
-
- Find Minimum in Rotated Sorted Array (3) *
-
- Find Minimum in Rotated Sorted ArrayII (4) *
-
- Min Stack (2)
-
- Intersection of Two Linked Lists (2)
-
- Find Peak Element (2) (Binary Search)
-
- Maximum Gap (5) * (Bucket Sort)
-
- Compare Version Numbers (2)
-
- Fraction to Recurring Decimal (3)
-
- Excel Sheet Column Title (3)
-
- Majority Element (2) *
-
- Excel Sheet Column Number (2)
-
- Factorial Trailing Zeroes (3)
-
- Binary Search Tree Iterator (3) *
-
- Dungeon Game (5) (Dynamic Programming) *
-
- Largest Number (3)
-
- Repeated DNA Sequences (3) *
-
- Best Time to Buy and Sell Stock IV (5) (Dynamic Programming) *
-
- Rotate Array (3) (Programming Perls) (Swap, Reverse)
-
- Reverse Bits (2)
-
- Number of 1 Bits (2)
-
- House Robber (2)
-
- Binary Tree Right Side View (2)
-
- Number of Islands (3) (Union Find, DFS)
-
- Bitwise AND of Numbers Range (Bit manipulation) *
-
- Happy Number (2)
-
- Remove Linked List Elements (1)
-
- Count Primes (2) *
-
- Isomorphic Strings (2)
-
- Reverse Linked List (2) (Iterative, Recursive)
-
- Course Schedule (5) (Topological Sort, DFS)
-
- Implement Trie (Prefix Tree) (3)
-
- Minimum Size Subarray Sum (3) (Slide Window)
-
- Course ScheduleII (3) (Topological Sort) *
-
- Add and Search Word - Data structure design (Trie) *
-
- Word Search II (Trie, Backtracking) (Trie, BackTracking) *
-
- House Robber II (Dynamic Programming) *
-
- Shortest Palindrome (String) *
-
- Kth LargestElement in an Array
-
- Combination Sum III
-
- Contains Duplicate * 218. The Skyline Problem ** (PriorityQueue, BIT, SegmentTree) * 219. Contains DuplicateII
-
- Contains DuplicateIII
-
- Maximal Square (Dynamic Programming) *
-
- Count Complete Tree Nodes (Binary Search) **
-
- Rectangle Area
-
- Basic Calculator
-
- Implement Stack Using Queues
-
- Invert Binary Tree
-
- Basic CalculatorII
-
- Summary Ranges
-
- Majority ElementII
-
- Kth Smallest Element in a BST
-
- Power of Two
-
- Implement Queue using Stacks
-
- Number Of Digit One
-
- Palindrome LinkedList
-
- Lowest Common Ancestor of a Binary Search Tree
-
- Lowest Common Ancestor of a Binary Tree
-
- Delete Node in a Linked List
-
- Product of Array Except Self
-
- Sliding Window Maximum (Double Ended Queue) **
-
- Search a 2D MatrixII
-
- Different Ways to Add Parentheses (Divide and Conquer) *
-
- Valid Anagram
-
- Binary Tree Paths *
-
- Ugly Number
-
- Ugly Number II (Heap) *
-
- Missing Number
-
- Integer to English Words
-
- H-Index
-
- H-IndexII
-
- First Bad Version
-
- Perfect Squares
-
- Expression Add Operators
-
- Move Zeroes
-
- Peeking Iterator
-
- Find the Duplicate Number
-
- Game of Life
-
- Word Pattern
-
- Find Median from Data Stream (Heap)
-
- Serialize and Deserialize Binary Tree
-
- Bulls and Cows
-
- Longest Increasing Subsequence (Dynamic Programming)
-
- Remove Invalid Parentheses ()
-
- Range Sum Query - Immutable (Dynamic Programming)
-
- Range Sum Query 2D - Immutable (Dynamic Programming)
-
- Additive Number (NoTag)
-
- Range Sum Query(Fenwick Tree, SegmentTree) ******
-
- Best time to buy and sell with cooldown(Dynamic Programming) ************************
-
- Minimum Height Tree (Graph, BFS) ********
-
- Burst Ballons (Divide and Conquer, DP) **********************
-
- Super Ugly Number(Math, Heap) ****
-
- Count of Smaller Numbers After Self(Binary Indexed Tree / Segment Tree) ****
-
- Remove Duplicate Letters(Stack, Greedy) *
-
- Maximum Product of Word Length(Bit Manimulation)
-
- Bulb Switcher(Math) *
-
- Create Maximum Number(Greedy) ****
-
- Coin Change (Dynamic Programming) *
-
- Wiggle Sort II (Quick Select, Three Way Partition) ****
-
- Power of Three (math)
-
- Count of Range Sum (Binary Indexed Tree / Segment Tree) ****
-
- Odd Even LinkedList(Linked List)
-
- Longest Increasing Path in a Matrix (DFS, Topological Sort, Memoization) *
-
- Pathcing Array (Greedy) *
-
- Verify Preorder Serialization of a Binary Tree (Stack)
-
- Reconstruct Itinerary (Graph)
-
- Longest Substring with At Least K Repeating Characters (Bit Manipulation);