Solutions to all Leetcode programming problems as of 13th January, 2019 (657/657).
- 01 Matrix
- 132 Pattern
- 24 Game
- 3 Sum Closest
- 3 Sum Smaller
- 3 Sum
- 4 Sum II
- 4 Sum
- Add Binary
- Add One Row to Tree
- Add Strings
- Add Two Numbers II
- Add Two Numbers
- Add and Search Word Data structure design
- Add digits
- Additive Number
- Alien Dictionary
- All O one Data Structure
- All Paths From Source to Target
- All Possible Full Binary Trees
- Anagrams
- Arithmetic Slices II - Subsequence
- Arithmetic Slices
- Arranging Coins
- Array Nesting
- Array Partition I
- Assign Cookies
- Average of Levels in Binary Tree
- Backspace String Compare
- Balanced Binary Tree
- Base 7
- Baseball Game
- Basic Calculator II
- Basic Calculator
- Battleships in a Board
- Beautiful Arrangement II
- Beautiful Arrangement
- Best Meeting Point
- Best Time to Buy and Sell Stock III
- Best Time to Buy and Sell Stock II
- Best Time to Buy and Sell Stock IV
- Best Time to Buy and Sell Stock with Cooldown
- Best Time to Buy and Sell Stock with Transaction Fee
- Best Time to Buy and Sell Stock
- Binary Gap
- Binary Number with Alternating Bits
- Binary Search Tree Iterator
- Binary Tree Cameras
- Binary Tree Inorder Traversal
- Binary Tree Level Order Traversal II
- Binary Tree Level Order Traversal
- Binary Tree Longest Consecutive Sequence II
- Binary Tree Longest Consecutive Sequence
- Binary Tree Maximum Path Sum
- Binary Tree Postorder Traversal
- Binary Tree Preorder Traversal
- Binary Tree Tilt
- Binary Tree Upside Down
- Binary Tree Vertical Order Traversal
- Binary Tree Zigzag Level Order Traversal
- Binary Watch
- Binary tree Right Side View
- Binary tree paths
- Bitwise AND of Numbers Range
- Bomb Enemy
- Brick Wall
- Bricks Falling When Hit
- Bulb Switcher II
- Bulb Switcher
- Bulls and Cows
- Burst Balloons
- Can I Win
- Can Place Flowers
- Candy
- Check Completeness of a Binary Tree
- Climbing Stairs
- Clone Graph
- Closest Binary Search Tree Value II
- Closest Binary Search Tree Value
- Coin Change 2
- Coin Change
- Combination Sum III
- Combination Sum II
- Combination Sum IV
- Combination Sum
- Combinations
- Combine Two Tables
- Compare Version Numbers
- Complex Number Multiplication
- Concatenated Words
- Consecutive Numbers
- Construct Binary Tree from Inorder and Postorder Traversal
- Construct Binary Tree from Inorder and Preorder Traversal
- Construct Binary Tree from Preorder and Postorder Traversal
- Construct Binary Tree from String
- Construct String from Binary Tree
- Construct the Rectangle
- Container With Most Water
- Contains Duplicate III
- Contains Duplicate II
- Contains Duplicate
- Contiguous Array
- Continuous Subarray Sum
- Convert BST to Greater Tree
- Convert Binary Search Tree to Sorted Doubly Linked List
- Convert Sorted Array to Binary Search Tree
- Convert Sorted List to Binary Search Tree
- Convert a Number to Hexadecimal
- Convex Polygon
- Copy List with Random Pointer
- Count Binary Substrings
- Count Complete Tree Nodes
- Count Numbers with Unique Digits
- Count Univalue Subtrees
- Count and Say
- Count of Range Sum
- Count of Smaller Numbers After Self
- Count primes
- Counting Bits
- Course Schedule II
- Course Schedule
- Create Maximum Number
- Custom Sort String
- Customers Who Never Order
- Cut Off Trees for Golf Event
- DI String Match
- Daily Temperatures
- Data Stream as Disjoint Intervals
- Decode String
- Decode Ways II
- Decode Ways
- Degree of an Array
- Delete Duplicate Emails
- Delete Node in a BST
- Delete Node in a Linked List
- Delete Operation for Two Strings
- Department Highest Salary
- Design Circular Queue
- Design HashMap
- Design Hit Counter
- Design Phone Directory
- Design Search Autocomplete System
- Design Snake Game
- Design Tic-Tac-Toe
- Design Twitter
- Detect Capital
- Diagonal Traverse
- Diameter of Binary Tree
- Different Ways to Add Parentheses
- Distinct Subsequences
- Distribute Candies
- Divide Two Integers
- Dungeon Game
- Duplicate Emails
- Edit Distance
- Elimination Game
- Employee Importance
- Employees Earning More Than Their Managers
- Encode String with Shortest Length
- Encode and Decode Strings
- Encode and Decode TinyURL
- Equal Tree Partition
- Evaluate Division
- Evaluate Reverse Polish Notation
- Excel Sheet Column Number
- Excel Sheet Column Title
- Exclusive Time of Functions
- Expression Add Operators
- Factor Combinations
- Factorial Trailing Zeroes
- Find All Anagrams in a String
- Find All Duplicates in an Array
- Find All Numbers Disappeared in an Array
- Find Anagram Mappings
- Find Bottom Left Tree Value
- Find Duplicate File in System
- Find Duplicate Subtrees
- Find First and Last Position of Element in Sorted Array
- Find K Closest Elements
- Find K Pairs with Smallest Sums
- Find Largest Value in Each Tree Row
- Find Leaves of Binary Tree
- Find Median from Data Stream
- Find Minimum in Rotated Sorted Array II
- Find Minimum in Rotated Sorted Array
- Find Peak Element
- Find Permutation
- Find Pivot Index
- Find Right Interval
- Find the Celebrity
- Find the Difference
- Find the Duplicate Number
- First Bad Version
- First Missing Positive
- First Unique Character in a String
- Fizz Buzz
- Flatten 2D Vector
- Flatten Binary Tree to Linked List
- Flatten Nested List Iterator
- Flatten a Multilevel Doubly Linked List
- Flip Equivalent Binary Trees
- Flip Game II
- Flip Game
- Flipping an Image
- Flood Fill
- Fraction to Recurring Decimal
- Freedom Trail
- Friend Circles
- Friend Requests I- Overall Acceptance Rate
- Friend Requests II- Who Has the Most Friends
- Friends Of Appropriate Ages
- Frog Jump
- Fruit Into Baskets
- Game of Life
- Gas Station
- Generalized Abbreviation
- Generate Parentheses
- Goat Latin
- Graph Valid Tree
- Gray Code
- Group Anagrams
- Group Shifted Strings
- Groups of Special-Equivalent Strings
- Guess Number Higher or Lower II
- Guess Number Higher or Lower
- H-Index II
- H-Index
- Hamming Distance
- Happy Numbers
- Heaters
- House Robber III
- House Robber II
- House Robber
- Image Smoother
- Implement Magic Dictionary
- Implement Stack using Queues
- Implement Trie (Prefix Tree)
- Implement strStr()
- Increasing Order Search Tree
- Increasing Subsequences
- Increasing Triplet Subsequence
- Inorder Successor in BST
- Insert Delete GetRandom O(1)-Duplicates allowed
- Insert Delete GetRandom O(1)
- Insert Interval
- Insert into a Cyclic Sorted List
- Insertion Sort List
- Integer Break
- Integer Replacement
- Integer to English Words
- Integer to Roman
- Interleaving String
- Intersection of Two Arrays II
- Intersection of Two Arrays
- Intersection of Two Linked Lists
- Invert Binary Tree
- Is Graph Bipartite?
- Is Subsequence
- Island Perimeter
- Isomorphic Strings
- Jewels and Stones
- Judge Route Circle
- Jump Game II
- Jump Game
- K Empty Slots
- K-diff Pairs in an Array
- Keyboard Row
- Kill Process
- Knight Probability in Chessboard
- Kth Largest Element in a Stream
- Kth Largest Element in an Array
- Kth Smallest Element in a BST
- Kth Smallest Element in a Sorted Matrix
- Kth Smallest Number in Multiplication Table
- LFU Cache
- LRU Cache
- Largest BST Subtree
- Largest Divisible Subset
- Largest Number
- Largest Palindrome Product
- Largest Plus Sign
- Largest Rectangle in Histogram
- Leaf-Similar Trees
- Length of Last Word
- Letter Case Permutation
- Letter Combinations of a Phone Number
- Lexicographical Numbers
- License Key Formatting
- Line Reflection
- Linked List Cycle II
- Linked List Cycle
- Linked List Random Node
- Logger Rate Limiter
- Lonely Pixel II
- Lonely Pixel I
- Longest Absolute File Path
- Longest Common Prefix
- Longest Consecutive Sequence
- Longest Continuous Increasing Subsequence
- Longest Harmonious Subsequence
- Longest Increasing Path in a Matrix
- Longest Increasing Subsequence
- Longest Palindrome
- Longest Palindromic Subsequence
- Longest Palindromic Substring
- Longest Repeating Character Replacement
- Longest Substrin with At Most K Distinct Characters
- Longest Substring Without Repeating Characters
- Longest Substring with At Least K Repeating Characters
- Longest Substring with At Most Two Distinct Characters
- Longest Uncommon Subsequence II
- Longest Uncommon Subsequence I
- Longest Univalue Path
- Longest Valid Parenthesis
- Longest Word in Dictionary through Deleting
- Lowest Common Ancestor Binary Search Tree
- Lowest Common Ancestor Binary Tree
- Magical String
- Majority Element II
- Majority Element
- Map Sum Pairs
- Matchsticks to Square
- Max Area of Island
- Max Consecutive Ones II
- Max Consecutive Ones
- Max Points on a Line
- Max Stack
- Max Sum of Rectangle No Larger Than K
- Maximal Rectangle
- Maximal Square
- Maximum Average Subarray II
- Maximum Average Subarray I
- Maximum Binary Tree
- Maximum Depth of Binary Tree
- Maximum Distance in Arrays
- Maximum Gap
- Maximum Length of Pair Chain
- Maximum Product Subarray
- Maximum Product of Three Numbers
- Maximum Product of Word Lengths
- Maximum Size Subarray Sum Equals k
- Maximum Subarray
- Maximum Sum of 3 Non-Overlapping Subarrays
- Maximum Swap
- Maximum Width of Binary Tree
- Maximum XOR of Two Numbers in an Array
- Median of Two Sorted Arrays
- Meeting Rooms II
- Meeting Rooms
- Merge Intervals
- Merge Sorted Array
- Merge Two Binary Trees
- Merge Two Sorted Lists
- Merge k Sorted Lists
- Min Stack
- Minesweeper
- Mini Parser
- Minimum Absolute Difference in BST
- Minimum Add to Make Parentheses Valid
- Minimum Depth of Binary Tree
- Minimum Factorization
- Minimum Genetic Mutation
- Minimum Height Trees
- Minimum Moves to Equal Array Elements II
- Minimum Moves to Equal Array Elements
- Minimum Number of Arrows to Burst Balloons
- Minimum Path Sum
- Minimum Size Subarray Sum
- Minimum Swaps To Make Sequences Increasing
- Minimum Time Difference
- Minimum Window Substring
- Missing Number
- Missing Ranges
- Monotonic Array
- Most Frequent Subtree Sum
- Move zeros
- Moving Average from Data Stream
- Multiply Strings
- N Queens
- N-Queens II
- Nested List Weight Sum
- Next Closest Time
- Next Greater Element III
- Next Greater Element II
- Next Greater Element I
- Next Permutation
- Nim Game
- Non-decreasing Array
- Non-negative Integers without Consecutive Ones
- Non-overlapping Intervals
- Nth Digit
- Number Complement
- Number Of Corner Rectangles
- Number of 1 Bits
- Number of Boomerangs
- Number of Connected Components in an Undirected Graph
- Number of Digit One
- Number of Distinct Islands
- Number of Islands II
- Number of Islands
- Number of Longest Increasing Subsequence
- Number of Matching Subsequences
- Number of Recent Calls
- Number of Segments in a String
- Odd Even Linked List
- One Edit Distance
- Ones and Zeroes
- Optimal Division
- Output Contest Matches
- Pacific Atlantic Water Flow
- Paint House II
- Paint House
- Palindrome Linked List
- Palindrome Number
- Palindrome Pairs
- Palindrome Partitioning II
- Palindrome Partitioning
- Palindrome Permutation II
- Palindrome Permutation
- Palindromic Substrings
- Partition Equal Subset Sum
- Partition List
- Partition to K Equal Sum Subsets
- Pascal's Triangle II
- Pascal's Triangle
- Patching array
- Path Sum III
- Path Sum II
- Path Sum
- Peak Index in a Mountain Array
- Peeking Iterator
- Perfect Number
- Perfect Rectangle
- Perfect Squares
- Permutation Sequence
- Permutation in String
- Permutations II
- Permutations
- Plus One Linked List
- Plus One
- Poor Pigs
- Populating Next Right Pointers in Each Node II
- Populating Next Right Pointers in Each Node
- Positions of Large Groups
- Possible Bipartition
- Pow(x, n)
- Power of Four
- Power of Three
- Power of Two
- Predict the Winner
- Prefix and Suffix Search
- Product of Array Except Self
- Queue Reconstruction by Height
- Random Pick Index
- Random Pick with Weight
- Range Addition
- Range Sum Query 2D Immutable
- Range Sum Query 2D-Mutable
- Range Sum Query Immutable
- Range Sum Query-Mutable
- Range Sum of BST
- Rank Scores
- Ransom Note
- Read N Characters Given Read4 II-Call multiple times
- Read N Characters Given Read4
- Rearrange String k Distance Apart
- Reconstruct Itinerary
- Reconstruct Original Digits from English
- Recover Binary Search Tree
- Rectangle Area
- Rectangle Overlap
- Redundant Connection II
- Redundant Connection
- Regular Expression Matching
- Relative Ranks
- Remove Boxes
- Remove Duplicate Letters
- Remove Duplicates from Sorted Array II
- Remove Duplicates from Sorted Array
- Remove Duplicates from Sorted List II
- Remove Duplicates from Sorted List
- Remove Element
- Remove Invalid Parentheses
- Remove K Digits
- Remove Linked List Elements
- Remove Nth Node From End of List
- Reorder List
- Reorganize String
- Repeated DNA Sequences
- Repeated String Match
- Repeated Substring Pattern
- Replace Words
- Reshape the Matrix
- Restore IP Addresses
- Reverse Bits
- Reverse Integer
- Reverse Linked List II
- Reverse Linked List
- Reverse Nodes in k-Group
- Reverse Pairs
- Reverse String II
- Reverse String
- Reverse Vowels of a String
- Reverse Words in a String III
- Reverse Words in a String II
- Reverse Words in a String
- Rising Temperature
- Robot Return to Origin
- Robot Room Cleaner
- Roman to Integer
- Rotate Array
- Rotate Function
- Rotate Image
- Rotate List
- Rotate String
- Russian Doll Envelopes
- Same Tree
- Scramble String
- Search Insert Position
- Search a 2D Matrix II
- Search a 2D Matrix
- Search in Rotated Sorted Array II
- Search in Rotated Sorted Array
- Second Highest Salary
- Second Minimum Node In a Binary Tree
- Self Crossing
- Sequence Reconstruction
- Serialize and Deserialize BST
- Serialize and Deserialize Binary Tree
- Serialize and Deserialize N-ary Tree
- Set Matrix Zeroes
- Set Mismatch
- Shortest Distance from All Buildings
- Shortest Distance to a Character
- Shortest Palindrome
- Shortest Subarray with Sum at Least K
- Shortest Unsorted Continuous Subarray
- Shortest Word Distance III
- Shortest Word Distance II
- Shortest Word Distance
- Shuffle an Array
- Simplify Path
- Single Element in a Sorted Array
- Single Number III
- Single Number II
- Single Number
- Sliding Window Maximum
- Sliding Window Median
- Smallest Good Base
- Smallest Rectangle Enclosing Black Pixels
- Smallest Subtree with all the Deepest Nodes
- Sort Characters By Frequency
- Sort Colors
- Sort List
- Sort Transformed Array
- Sparse Matrix Multiplication
- Spiral Matrix II
- Spiral Matrix
- Split Array Largest Sum
- Split Array into Consecutive Subsequences
- Sqrt(x)
- Stickers to Spell Word
- String Compression
- String to Integer (atoi)
- Strobogrammatic Number III
- Strobogrammatic Number II
- Strobogrammatic Number
- Student Attendance Record II
- Student Attendance Record I
- Subarray Product Less Than K
- Subarray Sum Equals K
- Subdomain Visit Count
- Subsets II
- Subsets
- Substring with Concatenation of All Words
- Subtree of Another Tree
- Sudoku Solver
- Sum Root to Leaf Numbers
- Sum of Left Leaves
- Sum of Square Numbers
- Sum of Two Integers
- Summary Ranges
- Super Pow
- Super Ugly Number
- Super Washing Machines
- Surrounded Regions
- Swap Nodes in Pairs
- Symmetric Tree
- Target Sum
- Task Scheduler
- Teemo Attacking
- Tenth Line
- Ternary Expression Parser
- Text Justification
- The Skyline Problem
- Third Maximum Number
- Top K Frequent Elements
- Top K Frequent Words
- Total Hamming Distance
- Trapping Rain Water II
- Trapping Rain Water
- Triangle
- Trim a Binary Search Tree
- Two Sum II-Input array is sorted
- Two Sum III-Data structure design
- Two Sum IV - Input is a BST
- Two Sum
- UTF-8 Validation
- Ugly Number II
- Ugly Number
- Unique Binary Search Trees II
- Unique Binary Search Trees
- Unique Email Addresses
- Unique Paths II
- Unique Paths
- Unique Substrings in Wraparound String
- Unique Word Abbreviation
- Valid Anagram
- Valid Mountain Array
- Valid Number
- Valid Palindrome II
- Valid Palindrome
- Valid Parentheses
- Valid Parenthesis String
- Valid Perfect Square
- Valid Phone Numbers
- Valid Square
- Valid Sudoku
- Valid Triangle Number
- Valid Word Abbreviation
- Valid Word Square
- Validate Binary Search Tree
- Validate IP Address
- Verify Preorder Sequence in Binary Search Tree
- Verify Preorder Serialization of a Binary Tree
- Verifying an Alien Dictionary
- Walls and Gates
- Water and Jug Problem
- Wiggle Sort II
- Wiggle Sort
- Wiggle Subsequence
- Wildcard Matching
- Word Break II
- Word Break
- Word Frequency
- Word Ladder II
- Word Ladder
- Word Pattern II
- Word Pattern
- Word Search II
- Word Search
- Word Squares
- Word Subsets
- X of a Kind in a Deck of Cards
- ZigZag Conversion
- Zigzag Iterator
- Zuma Game