Answers for algorithm-questions from Leetcode in Javascript.
-
- Magical String
-
- Find Permutation
-
- Sort Characters By Frequency
-
- Maximum XOR of Two Numbers in an Array
-
- Diagonal Traverse
-
- Next Greater Element II
-
- Next Greater Element I
-
- Boundary of Binary Tree
-
- Longest Word in Dictionary through Deleting
-
- Beautiful Arrangement
-
- Word Abbreviation
-
- 01 Matrix
-
- Lonely Pixel I
-
- Lonely Pixel II
-
- Output Contest Matches
-
- The Maze II
-
- The Maze
-
- Minimum Height Trees
-
- Serialize and Deserialize Binary Tree
-
- Range Sum Query 2D - Immutable
-
- Binary Tree Vertical Order Traversal
-
- Pow(x, n)
-
- Binary Tree Inorder Traversal
-
- Kth Smallest Element in a BST
-
- Verify Preorder Serialization of a Binary Tree
-
- Verify Preorder Serialization of a Binary Tree
-
- Kth Smallest Element in a Sorted Matrix
-
- Evaluate Division
-
- Encode and Decode TinyURL
-
- Insert Delete GetRandom O(1) - Duplicates allowed
-
- Insert Delete GetRandom O(1)
-
- Range Addition
-
- Super Ugly Number
-
- Combination Sum IV
-
- Target Sum
-
- Perfect Squares
-
- Queue Reconstruction by Height
-
- Game of Life
-
- 3Sum Smaller
-
- Wiggle Sort II
-
- Wiggle Sort
-
- Android Unlock Patterns
-
- Relative Ranks
-
- Detect Capital
-
- Reverse String II
-
- Find Mode in Binary Search Tree
-
- Minimum Absolute Difference in BST
-
- Heaters
-
- Find All Numbers Disappeared in an Array
-
- Number of Boomerangs
-
- Max Consecutive Ones II
-
- Max Consecutive Ones
-
- Power of Three
-
- Guess Number Higher or Lower
-
- Repeated Substring Pattern
-
- Valid Word Abbreviation
-
- Power of Two
-
- Valid Word Square
-
- Longest Palindrome
-
- Closest Binary Search Tree Value
-
- Island Perimeter
-
- Missing Number
-
- Nth Digit
-
- Paint Fence
-
- Binary Watch
-
- Find the Difference
-
- Flip Game II
-
- Flip Game
-
- Logger Rate Limiter
-
- Strobogrammatic Number II
-
- Strobogrammatic Number
-
- Reverse Vowels of a String
-
- Reverse String
-
- Add Strings
-
- Longest Common Prefix
-
- Number of Islands II
-
- Linked List Cycle II
-
- Ugly Number II
-
- Ugly Number
-
- Merge k Sorted Lists
- Rehashing
-
- Flatten Nested List Iterator
- Top k Largest Numbers
-
- Implement Queue using Stacks
-
- Kth Largest Element in an Array
- Kth Largest Element II
- K Closest Points
- High Five
-
- Nested List Weight Sum II
-
- Nested List Weight Sum
-
- Find the Duplicate Number
- Remove Duplicate Numbers in Array
-
- 3Sum Closest
-
- 3Sum
- Sort Colors II
-
- Sort Colors
-
- Binary Tree Zigzag Level Order Traversal
-
- Binary Search Tree Iterator
-
- Unique Word Abbreviation
-
- Encode and Decode Strings
-
- Plus One
-
- Decode String
-
- Missing Ranges
-
- Moving Average from Data Stream
-
- Bomb Enemy
-
- Zigzag Iterator
-
- Sentence Screen Fitting
-
- Range Sum Query 2D - Mutable
-
- Longest Substring with At Most Two Distinct Characters
-
- License Key Formatting
-
- Longest Absolute File Path
- Sort Colors
- Partition Array
-
- Two Sum II - Input array is sorted
- Two Sum Closest
- Two Sum VII - Difference equals to target
-
- Two Sum III - Data structure design
-
- Median of Two Sorted Arrays
-
- Sort List
-
- Linked List Cycle
-
- Merge Two Sorted Lists
-
- Word Ladder
-
- Word Break
-
- Palindrome Permutation
-
- Combination Sum
-
- Palindrome Partitioning
-
- Shortest Distance from All Buildings
-
- Clone Graph
-
- Graph Valid Tree
-
- Course Schedule II
-
- Course Schedule
-
- Validate Binary Search Tree
-
- Lowest Common Ancestor of a Binary Tree
-
- Binary Tree Paths
-
- Path Sum II
-
- LRU Cache
-
- Reverse Linked List II
-
- Reverse Linked List
-
- Populating Next Right Pointers in Each Node II
-
- Populating Next Right Pointers in Each Node
-
- Trapping Rain Water
-
- Unique Paths II
-
- Unique Paths
-
- Min Stack
-
- Move Zeroes
-
- Copy List with Random Pointer
-
- Best Time to Buy and Sell Stock
-
- Best Time to Buy and Sell Stock II
-
- Best Time to Buy and Sell Stock III
-
- Maximum Subarray
-
- Add Two Numbers II
-
- Add Two Numbers
-
- Merge Intervals
-
- Search a 2D Matrix II
-
- Search a 2D Matrix
-
- Flatten Binary Tree to Linked List
-
- Intersection of Two Linked Lists
-
- Delete Node in a Linked List
-
- Binary Tree Level Order Traversal
-
- Binary Tree Longest Consecutive Sequence
- Minimum Subtree
- Binary Tree Longest Consecutive Sequence
-
- Two Sum
-
- Binary Tree Maximum Path Sum
-
- Binary Tree Preorder Traversal
-
- Balanced Binary Tree
-
- Maximum Depth of Binary Tree
-
- Search in Rotated Sorted Array
-
- First Bad Version
-
- Find Peak Element
-
- Find Minimum in Rotated Sorted Array
-
- Sqrt(x)
-
- Permutations II
-
- Permutations
-
- Subsets II
-
- Subsets
-
- Implement strStr()