Welcome to my LeetCode problem solutions repository! ๐ Here, you'll find C++ solutions to a variety of interesting problems across different categories. Feel free to explore and learn from these solutions as you tackle your own LeetCode challenges. If you find this repository helpful, please consider giving it a โญ๏ธ!
- Search Insert Position
- Search a 2D Matrix
- Search a 2D Matrix II
- Find Peak Element
- Search in Rotated Sorted Array
- Find First and Last Position of Element in Sorted Array
- Find Minimum in Rotated Sorted Array
- Median of Two Sorted Arrays
- Ways to Split Array Into Three Subarrays
- Climbing Stairs
- House Robber
- Word Break
- All Possible Full Binary Trees
- Get Maximum in Generated Array
- N-th Tribonacci Number
- Longest Increasing Subsequence
- Coin Change
- Partition Array for Maximum Sum
- Egg Drop With 2 Eggs and N Floors
- Count Substrings That Differ by One Character
- Fair Distribution of Cookies
- Stone Game II
- Palindromic Substrings
- Longest ZigZag Path in a Binary Tree
- Longest Subarray of 1's After Deleting One Element
- Palindrome Partitioning
- Minimum Path Cost in a Grid
- Minimum Falling Path Sum
- Minimum Cost For Tickets
- Arithmetic Slices
- Minimum ASCII Delete Sum for Two Strings
- Minimum ASCII Delete Sum for Two Strings
- Beautiful Arrangement Solution
- Ways to Make a Fair Array
- Uncrossed Lines
- Longest Palindromic Subsequence
- Maximum Compatibility Score Sum
- Flip String to Monotone Increasing Solution
- Different Ways to Add Parentheses Solution
- Delete Operation for Two Strings
- Longest String Chain
- Unique Binary Search Trees
- Integer Break
- Maximum Sum of Two Non-Overlapping Subarrays
- Filling Bookcase Shelves
- Best Sightseeing Pair
- Maximum Alternating Subsequence Sum
- Maximum Absolute Sum of Any Subarray
- Minimum Deletions to Make String Balanced
- Number of Smooth Descent Periods of a Stock
- Make Costs of Paths Equal in a Binary Tree
- Find the City With the Smallest Number of Neighbors at a Threshold Distance
- Stone Game VII
- Longest Common Subsequence
- Shortest Common Supersequence
- Best Time to Buy and Sell Stock
- Best Time to Buy and Sell Stock II
- Best Time to Buy and Sell Stock with Cooldown
- Best Time to Buy and Sell Stock III
- Best Time to Buy and Sell Stock IV
- Edit Distance
- Find the Substring With Maximum Cost
- Unique Binary Search Trees II
- Delete and Earn
- Predict the Winner
- Count Ways To Build Good Strings
- Solving Questions With Brainpower
- Last Stone Weight II
- Vowels of All Substrings
- House Robber III
- House Robber II
- Combination Sum IV
- Largest Sum of Averages
- Jump Game
- Interleaving String
- Jump Game VI
- Binary Trees With Factors
- Extra Characters in a String
- Partition String Into Minimum Beautiful Substrings
- Domino and Tromino Tiling
- Video Stitching
- Maximum Length of Repeated Subarray
- Greatest Sum Divisible by Three
- Best Team With No Conflicts
- Number of Ways to Select Buildings
- Partition Equal Subset Sum
- Number of Ways to Paint N ร 3 Grid
- Cherry Pickup II
- Word Break II
- Largest Divisible Subset
- Number of Strings Which Can Be Rearranged to Contain Substring
- Minimum Sideway Jumps
- Time Needed to Rearrange a Binary String
- Find Good Days to Rob the Bank
- Wiggle Subsequence Solution
- Length of Longest Fibonacci Subsequence
- Largest Plus Sign
- Out of Boundary Paths
- Maximum Score After Applying Operations on a Tree
- Number of Longest Increasing Subsequence
- Count Number of Texts
- Closest Dessert Cost
- Longest Turbulent Subarray
- Maximum Points in an Archery Competition
- Number of People Aware of a Secret
- Ugly Number II
- Partition String Into Substrings With Values at Most K
- Super Ugly Number
- New 21 Game
- Maximum Length of Subarray With Positive Product
- Minimum Number of Coins for Fruits
- Kth Largest Element in an Array
- IPO
- Find K Pairs with Smallest Sums
- Find Median from Data Stream
- Minimum Cost to Hire K Workers
- Find the Kth Smallest Sum of a Matrix With Sorted Rows
- Sliding Window Maximum
- Top K Frequent Words
- Course Schedule III
- Closest Dessert Cost
- Largest Rectangle in Histogram
- Count Submatrices With All Ones
- Minimum Remove to Make Valid Parentheses
- Remove Duplicate Letters
- Next Greater Node In Linked List
- Longest Unequal Adjacent Groups Subsequence I
- Largest Values From Labels
- Reducing Dishes
- Next Permutation
- Previous Permutation With One Swap
- Text Justification
- Minimum Additions to Make Valid String
- Partition String Into Substrings With Values at Most K
- Minimum Number of Food Buckets to Feed the Hamsters
- Push Dominoes
- K-Similar Strings
- Recover a Tree From Preorder Traversal
- As Far from Land as Possible
- Binary Tree Zigzag Level Order Traversal
- Island Perimeter
- All Elements in Two Binary Search Trees
- Univalued Binary Tree
- Maximum of Absolute Value Expression
- Insert Delete GetRandom O(1)
- Exam Room
- Design Underground System
- Random Pick with Weight
- LRU Cache
- Implement Trie (Prefix Tree)
- Online Election
- Remove Nth Node From End of List
- Reorder List
- Evaluate Division
- All Elements in Two Binary Search Trees
- Course Schedule
- Course Schedule II
- Binary Tree Maximum Path Sum
- Cheapest Flights Within K Stops
- Binary Tree Coloring Game
- Lowest Common Ancestor of Deepest Leaves
- Maximum Difference Between Node and Ancestor
- Network Delay Time (Dijkstra)
- Path With Minimum Effort (Dijkstra)
- Clone Graph
- Populating Next Right Pointers in Each Node II
- Lowest Common Ancestor of a Binary Tree
- All Paths From Source to Target
- Min Cost to Connect All Points
- Count the Number of Complete Components
- Minimum Height Trees
- Sum of Root To Leaf Binary Numbers
- Number of Ways to Split Array
- Sort Array By Parity II
- Distance Between Bus Stops
- Find the Highest Altitude
- How Many Numbers Are Smaller Than the Current Number
- Count Nice Pairs in an Array
- Partition Array Into Three Parts With Equal Sum
- Binary Prefix Divisible By 5
- Most Stones Removed with Same Row or Column
- Number of Islands
- Toeplitz Matrix
- Bulls and Cows
- Brace Expansion II Solution
- Unique Paths III
- Max Increase to Keep City Skyline
- Set Matrix Zeroes ๐คข (genuinely hate this problem)
- Battleships in a Board
- Binary String With Substrings Representing 1 To N
- Candy
- Restore IP Addresses
- Minimum Time to Make Rope Colorful
- Pow(x, n)
- Partition Array into Disjoint Intervals
- Brick Wall
- Array Nesting
- Minimum Number of Steps to Make Two Strings Anagram II
- Remove Letter To Equalize Frequency
- Find the Town Judge
- Shopping Offers
- Check if There is a Valid Partition For The Array
- Number of Matching Subsequences
- Find Valid Matrix Given Row and Column Sums
- Minimum Distance to Type a Word Using Two Fingers
- Find All Anagrams in a String
- Expressive Words
- The Skyline Problem
- Remove Adjacent Almost-Equal Characters
- Max Points on a Line
- Spiral Matrix
- Remove Comments
- N-Repeated Element in Size 2N Array
- 4Sum II
- Increasing Triplet Subsequence
- Increasing Triplet Subsequence
- Rotate Image
- Permutations
- Car Pooling
- Swap For Longest Repeated Character Substring
- Optimal Partition of String
- Target Sum
- Get Biggest Three Rhombus Sums in a Grid
- Minimum Consecutive Cards to Pick Up
- Minimize Maximum of Array
- Maximum Repeating Substring
- Shortest Completing Word
- Shortest Distance to a Character
- Number of Lines To Write String
- Largest Triangle Area
- Transpose Matrix
- Largest Perimeter Triangle
Happy coding! If you have any questions or suggestions, feel free to open an issue or create a pull request.
๐ Happy Learning! ๐
Knuth-Morris-Pratt (KMP)- Dijkstra
- Floyd-Warshall
- DSU
- NextPermutation