# Page Index - codewithsenpai/algos Wiki

458 page(s) in this GitHub Wiki:

- Home
- **Combo Lists
- **Companies
- **Discipline
- **Pattern Map
- **Python
- **System Design
- **Templates
- *Binary Search
- *Cyclic Sort
- *Dynamic Programming
- *Merge Sort
- *Tree Traversals
- LC 0001 [E] Two Sum 2Sum
- LC 0002 [M] Add Two Numbers
- LC 0003 [M] Longest Substring Without Repeating Characters
- LC 0004 [H] Median of Two Sorted Arrays
- LC 0005 [M] Longest Palindromic Substring
- LC 0008 [M] String to Integer (atoi)
- LC 0009 [E] Palindrome Number
- LC 0010 [H] Regular Expression Matching
- LC 0011 [M] Container With Most Water
- LC 0013 [E] Roman to Integer
- LC 0014 [E] Longest Common Prefix
- LC 0015 [M] 3Sum
- LC 0016 [M] 3Sum Closest
- LC 0017 [M] Letter Combinations of a Phone Number
- LC 0018 [M] 4Sum
- LC 0019 [M] Remove Nth Node From End of List
- LC 0020 [E] Valid Parentheses
- LC 0021 [E] Merge Two Sorted Lists
- LC 0022 [M] Generate Parentheses
- LC 0023 [H] Merge k Sorted Lists
- LC 0024 [M] Swap Nodes in Pairs
- LC 0025 [H] Reverse Nodes in k Group
- LC 0026 [E] Remove Duplicates from Sorted Array
- LC 0029 [M] Divide Two Integers
- LC 0030 [H] Substring with Concatenation of All Words
- LC 0031 [M] Next Permutation
- LC 0032 [H] Longest Valid Parentheses
- LC 0033 [M] Search in Rotated Sorted Array
- LC 0034 [M] Find First and Last Position of Element in Sorted Array
- LC 0035 [E] Search Insert Position
- LC 0036 [M] Valid Sudoku
- LC 0037 [H] Sudoku Solver
- LC 0038 [M] Count and Say
- LC 0039 0040 0216 0377 [M] [M] [M] [M] Combination Sum (Subset Sum) I II III IV
- LC 0041 [H] First Missing Positive
- LC 0042 [H] Trapping Rain Water
- LC 0043 [M] Multiply Strings
- LC 0044 [H] Wildcard Matching
- LC 0045 [M] Jump Game II
- LC 0046 0047 [M] [M] Permutations I II
- LC 0048 [M] Rotate Image
- LC 0049 [M] Group Anagrams
- LC 0050 [M] Pow(x, n)
- LC 0051 [H] N Queens
- LC 0053 [E] Maximum Subarray
- LC 0054 [M] Spiral Matrix
- LC 0055 [M] Jump Game
- LC 0056 [M] Merge Intervals
- LC 0057 [M] Insert Interval
- LC 0062 [M] Unique Paths
- LC 0063 [M] Unique Paths II
- LC 0064 [M] Minimum Path Sum
- LC 0065 [H] Valid Number
- LC 0066 [E] Plus One
- LC 0067 [E] Add Binary
- LC 0068 [H] Text Justification
- LC 0070 [E] Climbing Stairs
- LC 0071 [M] Simplify Path
- LC 0072 [H] Edit Distance (Levenshtein Distance)
- LC 0073 [M] Set Matrix Zeroes
- LC 0074 [M] Search a 2D Matrix
- LC 0075 [M] Sort Colors (Dutch National Flag Partition)
- LC 0076 [H] Minimum Window Substring
- LC 0077 [M] Combinations
- LC 0078 0090 [M] [M] Subsets I II
- LC 0079 [M] Word Search
- LC 0082 [M] Remove Duplicates from Sorted List II
- LC 0083 [E] Remove Duplicates from Sorted List
- LC 0084 [H] Largest Rectangle in Histogram
- LC 0088 [E] Merge Sorted Array
- LC 0091 [M] Decode Ways
- LC 0092 [M] Reverse Linked List II
- LC 0093 [M] Restore IP Addresses
- LC 0095 [M] Unique Binary Search Trees II
- LC 0096 [M] Unique Binary Search Trees
- LC 0097 [H] Interleaving String
- LC 0098 [E] Validate Binary Search Tree
- LC 0100 [E] Same Tree
- LC 0101 [E] Symmetric Tree
- LC 0102 [M] Binary Tree Level Order Traversal
- LC 0103 [M] Binary Tree Zigzag Level Order Traversal
- LC 0104 [E] Maximum Depth of Binary Tree
- LC 0107 [E] Binary Tree Level Order Traversal II
- LC 0108 [E] Convert Sorted Array to Binary Search Tree
- LC 0109 [M] Convert Sorted List to Binary Search Tree
- LC 0110 [E] Balanced Binary Tree
- LC 0111 [E] Minimum Depth of Binary Tree
- LC 0112 [E] Path Sum
- LC 0113 [M] Path Sum II
- LC 0114 [M] Flatten Binary Tree to Linked List
- LC 0116 [M] Populating Next Right Pointers in Each Node
- LC 0117 [M] Populating Next Right Pointers in Each Node II
- LC 0121 0122 0714 0309 0123 0188 [E] [E] [M] [M] [H] [H] Best Time to Buy and Sell Stock I, II, Transaction Fee, Cooldown, III, IV
- LC 0124 [H] Binary Tree Maximum Path Sum
- LC 0125 0680 [E] [E] Valid Palindrome I II
- LC 0126 [H] Word Ladder II
- LC 0127 [H] Word Ladder
- LC 0128 [M] Longest Consecutive Sequence
- LC 0129 [M] Sum Root to Leaf Numbers
- LC 0131 [M] Palindrome Partitioning
- LC 0133 [M] Clone Graph
- LC 0136 [E] Single Number
- LC 0138 [M] Copy List with Random Pointer
- LC 0139 [M] Word Break
- LC 0140 [H] Word Break II
- LC 0141 [E] Linked List Cycle
- LC 0143 [M] Reorder List
- LC 0144 [M] Binary Tree Preorder Traversal
- LC 0145 [H] Binary Tree Postorder Traversal
- LC 0146 [M] LRU Cache
- LC 0148 [M] Sort List
- LC 0150 [M] Evaluate Reverse Polish Notation
- LC 0152 [M] Maximum Product Subarray
- LC 0153 [M] Find Minimum in Rotated Sorted Array
- LC 0154 [H] Find Minimum in Rotated Sorted Array II
- LC 0155 [E] Min Stack
- LC 0157 [E] Read N Characters Given Read4
- LC 0158 [H] Read N Characters Given Read4 II Call multiple times
- LC 0159 [M] Longest Substring with At Most Two Distinct Characters
- LC 0160 [E] Intersection of Two Linked Lists
- LC 0161 [M] One Edit Distance
- LC 0162 [M] Find Peak Element
- LC 0163 [E] Missing Ranges
- LC 0164 [H] Maximum Gap
- LC 0166 [M] Fraction to Recurring Decimal
- LC 0167 [E] Two Sum 2Sum II Input array is sorted
- LC 0169 [E] Majority Element
- LC 0173 [M] Binary Search Tree Iterator
- LC 0174 [H] Dungeon Game
- LC 0179 [M] Largest Number
- LC 0189 [M] Rotate Array
- LC 0198 [E] House Robber
- LC 0199 [M] Binary Tree Right Side View
- LC 0200 [M] Number of Islands
- LC 0202 [E] Happy Number
- LC 0203 [E] Remove Linked List Elements
- LC 0206 [E] Reverse Linked List
- LC 0207 0210 [M] [M] Course Schedule I, II
- LC 0208 [M] Implement Trie (Prefix Tree)
- LC 0209 [M] Minimum Size Subarray Sum
- LC 0211 [M] Design Add and Search Words Data Structure
- LC 0212 [H] Word Search II
- LC 0215 [M] Kth Largest Element in an Array
- LC 0217 [E] Contains Duplicate
- LC 0219 [E] Contains Duplicate II
- LC 0224 0227 0772 [H] [M] [H] Basic Calculator I II III
- LC 0226 [E] Invert Binary Tree
- LC 0228 [E] Summary Ranges
- LC 0230 [M] Kth Smallest Element in a BST
- LC 0235 [E] Lowest Common Ancestor of a Binary Search Tree
- LC 0236 [M] Lowest Common Ancestor of a Binary Tree (LCA)
- LC 0238 [M] Product of Array Except Self
- LC 0239 [H] Sliding Window Maximum
- LC 0241 [M] Different Ways to Add Parentheses
- LC 0242 [E] Valid Anagram
- LC 0246 [E] Strobogrammatic Number
- LC 0247 [M] Strobogrammatic Number II
- LC 0249 [M] Group Shifted Strings
- LC 0250 [M] Count Univalue Subtrees
- LC 0252 [E] Meeting Rooms
- LC 0253 [M] Meeting Rooms II
- LC 0257 [E] Binary Tree Paths
- LC 0259 [M] 3Sum Smaller
- LC 0261 [M] Graph Valid Tree
- LC 0266 [E] Palindrome Permutation
- LC 0267 [M] Palindrome Permutation II
- LC 0268 [E] Missing Number
- LC 0269 [H] Alien Dictionary
- LC 0270 [E] Closest Binary Search Tree Value
- LC 0271 [M] Encode and Decode Strings
- LC 0273 [H] Integer to English Words
- LC 0274 [M] H Index
- LC 0277 [M] Find the Celebrity
- LC 0278 [E] First Bad Version
- LC 0279 [M] Perfect Squares
- LC 0282 [H] Expression Add Operators
- LC 0283 [E] Move Zeroes
- LC 0285 [M] Inorder Successor in BST
- LC 0286 [M] Walls and Gates
- LC 0287 [M] Find the Duplicate Number
- LC 0295 [H] Find Median from Data Stream
- LC 0296 [H] Best Meeting Point
- LC 0297 [H] Serialize and Deserialize Binary Tree
- LC 0298 [M] Binary Tree Longest Consecutive Sequence
- LC 0300 [M] Longest Increasing Subsequence (LIS)
- LC 0301 [H] Remove Invalid Parentheses
- LC 0304 [M] Range Sum Query 2D Immutable
- LC 0310 [M] Minimum Height Trees
- LC 0311 [M] Sparse Matrix Multiplication
- LC 0316 [M] Remove Duplicate Letters
- LC 0317 [H] Shortest Distance from All Buildings
- LC 0319 [M] Bulb Switcher
- LC 0320 [M] Generalized Abbreviation
- LC 0322 [M] Coin Change (min coins to make amount)
- LC 0323 [M] Number of Connected Components in an Undirected Graph
- LC 0325 [M] Maximum Size Subarray Sum Equals k
- LC 0328 [M] Odd Even Linked List
- LC 0329 [H] Longest Increasing Path in a Matrix
- LC 0332 [H] Reconstruct Itinerary
- LC 0333 [M] Largest BST Subtree
- LC 0334 [M] Increasing Triplet Subsequence
- LC 0337 [M] House Robber III
- LC 0339 [M] Nested List Weight Sum
- LC 0340 [M] Longest Substring with At Most K Distinct Characters
- LC 0341 [M] Flatten Nested List Iterator
- LC 0343 [M] Integer Break
- LC 0346 [E] Moving Average from Data Stream
- LC 0347 [M] Top K Frequent Elements
- LC 0348 [M] Design Tic Tac Toe
- LC 0349 [E] Intersection of Two Arrays
- LC 0350 [E] Intersection of Two Arrays II
- LC 0366 [M] Find Leaves of Binary Tree
- LC 0367 [E] Valid Perfect Square
- LC 0371 [M] Sum of Two Integers
- LC 0378 [M] Kth Smallest Element in a Sorted Matrix
- LC 0380 [M] Insert Delete GetRandom O(1)
- LC 0381 [H] Insert Delete GetRandom O(1) Duplicates allowed
- LC 0384 [M] Shuffle an Array
- LC 0394 [M] Decode String
- LC 0398 [M] Random Pick Index
- LC 0399 [M] Evaluate Division
- LC 0406 [M] Queue Reconstruction by Height
- LC 0408 [E] Valid Word Abbreviation
- LC 0410 [H] Split Array Largest Sum
- LC 0415 [E] Add Strings
- LC 0416 [M] Partition Equal Subset Sum
- LC 0419 [M] Battleships in a Board
- LC 0424 [M] Longest Repeating Character Replacement
- LC 0426 [M] Convert Binary Search Tree to Sorted Doubly Linked List
- LC 0429 [M] N ary Tree Level Order Traversal
- LC 0435 [M] Non overlapping Intervals
- LC 0436 [M] Find Right Interval
- LC 0437 [M] Path Sum III
- LC 0438 [M] Find All Anagrams in a String
- LC 0442 [M] Find All Duplicates in an Array
- LC 0443 [M] String Compression
- LC 0448 [M] Find All Numbers Disappeared in an Array
- LC 0450 [M] Delete Node in a BST
- LC 0451 [M] Sort Characters By Frequency
- LC 0454 [M] 4Sum II
- LC 0463 [E] Island Perimeter
- LC 0468 [M] Validate IP Address
- LC 0472 [H] Concatenated Words
- LC 0480 [H] Sliding Window Median
- LC 0489 [H] Robot Room Cleaner
- LC 0490 [M] The Maze
- LC 0494 [M] Target Sum
- LC 0496 [E] Next Greater Element I
- LC 0498 [M] Diagonal Traverse
- LC 0502 [H] IPO
- LC 0503 [M] Next Greater Element II
- LC 0509 [E] Fibonacci Number
- LC 0510 [M] Inorder Successor in BST II
- LC 0515 [M] Find Largest Value in Each Tree Row
- LC 0518 [M] Coin Change 2 (num ways to make amount)
- LC 0523 [M] Continuous Subarray Sum
- LC 0525 [M] Contiguous Array
- LC 0528 [M] Random Pick with Weight
- LC 0529 [M] Minesweeper
- LC 0536 [M] Construct Binary Tree from String
- LC 0540 [M] Single Element in a Sorted Array
- LC 0543 [E] Diameter of Binary Tree
- LC 0545 [M] Boundary of Binary Tree
- LC 0556 [M] Next Greater Element III
- LC 0560 [M] Subarray Sum Equals K
- LC 0567 [M] Permutation in String
- LC 0572 [E] Subtree of Another Tree
- LC 0581 [M] Shortest Unsorted Continuous Subarray
- LC 0597 [E] Friend Requests I: Overall Acceptance Rate
- LC 0605 [E] Can Place Flowers
- LC 0610 [E] Triangle Judgement
- LC 0616 [M] Add Bold Tag in String
- LC 0617 [E] Merge Two Binary Trees
- LC 0621 [M] Task Scheduler
- LC 0622 [M] Design Circular Queue
- LC 0636 [M] Exclusive Time of Functions
- LC 0637 [E] Average of Levels in Binary Tree
- LC 0643 [E] Maximum Average Subarray I
- LC 0645 [E] Set Mismatch
- LC 0647 [M] Palindromic Substrings
- LC 0648 [M] Replace Words
- LC 0658 [M] Find K Closest Elements
- LC 0662 [M] Maximum Width of Binary Tree
- LC 0669 [M] Trim a Binary Search Tree
- LC 0670 [M] Maximum Swap
- LC 0674 [E] Longest Continuous Increasing Subsequence
- LC 0676 [M] Implement Magic Dictionary
- LC 0678 [M] Valid Parenthesis String
- LC 0689 [H] Maximum Sum of 3 Non Overlapping Subarrays
- LC 0691 [H] Stickers to Spell Word
- LC 0692 [M] Top K Frequent Words
- LC 0694 [M] Number of Distinct Islands
- LC 0695 [M] Max Area of Island
- LC 0698 [M] Partition to K Equal Sum Subsets
- LC 0702 [M] Search in a Sorted Array of Unknown Size
- LC 0703 [E] Kth Largest Element in a Stream
- LC 0708 [M] Insert into a Sorted Circular Linked List
- LC 0713 [M] Subarray Product Less Than K
- LC 0714 [E] Binary Search
- LC 0716 [E] Max Stack
- LC 0719 [H] Find K th Smallest Pair Distance
- LC 0721 [M] Accounts Merge
- LC 0723 [M] Candy Crush
- LC 0724 [M] Find Pivot Index
- LC 0730 [H] Count Different Palindromic Subsequences
- LC 0735 [M] Asteroid Collision
- LC 0739 [M] Daily Temperatures
- LC 0740 [M] Delete and Earn
- LC 0742 [M] Closest Leaf in a Binary Tree
- LC 0744 [E] Find Smallest Letter Greater Than Target
- LC 0752 [M] Open the Lock
- LC 0759 [H] Employee Free Time
- LC 0763 [M] Partition Labels
- LC 0766 [E] Toeplitz Matrix
- LC 0767 [M] Reorganize String
- LC 0778 [H] Swim in Rising Water
- LC 0784 [M] Letter Case Permutation
- LC 0785 [M] Is Graph Bipartite?
- LC 0787 [M] Cheapest Flights Within K Stops
- LC 0788 [M] Rotated Digits
- LC 0791 [M] Custom Sort String
- LC 0814 [M] Binary Tree Pruning
- LC 0824 [E] Goat Latin
- LC 0825 [M] Friends Of Appropriate Ages
- LC 0827 [H] Making A Large Island
- LC 0844 [E] Backspace String Compare
- LC 0852 [E] Peak Index in a Mountain Array
- LC 0862 [H] Shortest Subarray with Sum at Least K
- LC 0863 [M] All Nodes Distance K in Binary Tree
- LC 0865 [M] Smallest Subtree with all the Deepest Nodes
- LC 0875 [M] Koko Eating Bananas
- LC 0876 [E] Middle of the Linked List
- LC 0886 [M] Possible Bipartition
- LC 0895 [H] Maximum Frequency Stack
- LC 0896 [E] Monotonic Array
- LC 0897 [E] Increasing Order Search Tree
- LC 0909 [M] Snakes and Ladders
- LC 0919 [M] Complete Binary Tree Inserter
- LC 0921 [M] Minimum Add to Make Parentheses Valid
- LC 0932 [M] Beautiful Array
- LC 0934 [M] Shortest Bridge
- LC 0935 [M] Knight Dialer
- LC 0938 [E] Range Sum of BST
- LC 0939 [M] Minimum Area Rectangle
- LC 0951 [M] Flip Equivalent Binary Trees
- LC 0953 [E] Verifying an Alien Dictionary
- LC 0958 [M] Check Completeness of a Binary Tree
- LC 0963 [M] Minimum Area Rectangle II
- LC 0973 [M] K Closest Points to Origin
- LC 0974 [M] Subarray Sums Divisible by K
- LC 0977 [E] Squares of a Sorted Array
- LC 0979 [M] Distribute Coins in Binary Tree
- LC 0980 [H] Unique Paths III
- LC 0983 [M] Minimum Cost For Tickets
- LC 0986 [M] Interval List Intersections
- LC 0987 0314 [H] [M] Vertical Order Traversal of a Binary Tree, Binary Tree Vertical Order Traversal
- LC 1004 [M] Max Consecutive Ones III
- LC 1008 [M] Construct Binary Search Tree from Preorder Traversal
- LC 1011 [M] Capacity To Ship Packages Within D Days
- LC 1026 [M] Maximum Difference Between Node and Ancestor
- LC 1034 [M] Coloring A Border
- LC 1038 0538 [M] [M] Binary Search Tree to Greater Sum Tree, Convert BST to Greater Tree
- LC 1047 [E] Remove All Adjacent Duplicates In String
- LC 1048 [M] Longest String Chain
- LC 1053 [M] Previous Permutation With One Swap
- LC 1055 [M] Shortest Way to Form String
- LC 1060 [M] Missing Element in Sorted Array
- LC 1091 [M] Shortest Path in Binary Matrix
- LC 1094 [M] Car Pooling
- LC 1099 [E] Two Sum Less Than K
- LC 1102 [M] Path With Maximum Minimum Value
- LC 1104 [M] Path In Zigzag Labelled Binary Tree
- LC 1110 [M] Delete Nodes And Return Forest
- LC 1123 [M] Lowest Common Ancestor of Deepest Leaves
- LC 1161 [M] Maximum Level Sum of a Binary Tree
- LC 1192 [H] Critical Connections in a Network
- LC 1197 [M] Minimum Knight Moves
- LC 1206 [H] Design Skiplist
- LC 1207 [E] Unique Number of Occurrences
- LC 1209 [M] Remove All Adjacent Duplicates in String II
- LC 1213 [E] Intersection of Three Sorted Arrays
- LC 1216 [H] Valid Palindrome III
- LC 1218 [M] Longest Arithmetic Subsequence of Given Difference
- LC 1233 [M] Remove Sub Folders from the Filesystem
- LC 1244 [M] Design A Leaderboard
- LC 1245 [M] Tree Diameter
- LC 1249 [M] Minimum Remove to Make Valid Parentheses
- LC 1265 [M] Print Immutable Linked List in Reverse
- LC 1268 [M] Search Suggestions System
- LC 1269 [H] Number of Ways to Stay in the Same Place After Some Steps
- LC 1275 [E] Find Winner on a Tic Tac Toe Game
- LC 1288 [M] Remove Covered Intervals
- LC 1293 [H] Shortest Path in a Grid with Obstacles Elimination
- LC 1305 [M] All Elements in Two Binary Search Trees
- LC 1319 [M] Number of Operations to Make Network Connected
- LC 1326 [H] Minimum Number of Taps to Open to Water a Garden
- LC 1331 [E] Rank Transform of an Array
- LC 1344 [M] Angle Between Hands of a Clock
- LC 1361 [M] Validate Binary Tree Nodes
- LC 1382 [M] Balance a Binary Search Tree
- LC 1395 [M] Count Number of Teams
- LC 1424 [M] Diagonal Traverse II
- LC 1428 [M] Leftmost Column with at Least a One
- LC 1429 [M] First Unique Number
- LC 1430 [M] Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree
- LC 1443 [M] Minimum Time to Collect All Apples in a Tree
- LC 1460 [E] Make Two Arrays Equal by Reversing Sub arrays
- LC 1498 [M] Number of Subsequences That Satisfy the Given Sum Condition
- LC 1522 [M] Diameter of N Ary Tree
- LC 1539 [E] Kth Missing Positive Number
- LC 1541 [M] Minimum Insertions to Balance a Parentheses String
- LC 1554 [M] Strings Differ by One Character
- LC 1559 [M] Detect Cycles in 2D Grid
- LC 1570 [M] Dot Product of Two Sparse Vectors
- LC 1614 [E] Maximum Nesting Depth of the Parentheses
- LC 1640 [E] Check Array Formation Through Concatenation
- LC 1644 [M] Lowest Common Ancestor of a Binary Tree II
- LC 1650 [M] Lowest Common Ancestor of a Binary Tree III
- LC 1721 [M] Swapping Nodes in a Linked List
- LC 1740 [M] Find Distance in a Binary Tree
- LC 1762 [M] Buildings With an Ocean View
- LC 1789 [E] Primary Department for Each Employee
- LC 1834 [M] Single Threaded CPU
- LC 1865 [M] Finding Pairs With a Certain Sum
- LC 1868 [M] Product of Two Run Length Encoded Arrays
- LC 1891 [M] Cutting Ribbons
- LC 1926 [M] Nearest Exit from Entrance in Maze
- LC 1944 [H] Number of Visible People in a Queue
- LC 1973 [M] Count Nodes Equal to Sum of Descendants
- LC 1985 [M] Find the Kth Largest Integer in the Array
- LC 1991 [E] Find the Middle Index in Array
- LC 2019 [H] The Score of Students Solving Math Expression
- LC 2025 [H] Maximum Number of Ways to Partition an Array
- LC 2033 [M] Minimum Operations to Make a Uni Value Grid
- LC 2056 [H] Number of Valid Move Combinations On Chessboard
- LC 2060 [H] Check if an Original String Exists Given Two Encoded Strings
- LC 2071 [H] Maximum Number of Tasks You Can Assign
- LC 2076 [H] Process Restricted Friend Requests
- LC 2081 [H] Sum of k Mirror Numbers
- LC 2090 [M] K Radius Subarray Averages
- LC 2092 [H] Find All People With Secret
- LC 2096 [M] Step By Step Directions From a Binary Tree Node to Another
- LC [H] 1263 Minimum Moves to Move a Box to Their Target Location
- Palindrome Linked List
- Trie: Autocomplete