This repository contains solutions to various LeetCode problems, organized by difficulty and topic.
- Total Problems: 155 solved
- Easy: 80 problems
- Medium: 63 problems
- Hard: 12 problems
Problems are organized by:
- Difficulty Level: Easy, Medium, Hard
- Topic: Arrays, Strings, Trees, Math, etc.
- Data Structures: Hash Tables, Stacks, Queues, etc.
- Algorithms: Hash Lookup, Two Pointers, Sliding Window, DFS, BFS, etc.
- 0001 - Two Sum
- 0009 - Palindrome Number
- 0020 - Valid Parentheses
- 0121 - Best Time to Buy and Sell Stock
- 0169 - Majority Element
- 0266 - Palindrome Permutation
- 0303 - Range Sum Query - Immutable
- 0205 - Isomorphic Strings
- 2168 - Check if Numbers Are Ascending in a Sentence
- 0383 - Ransom Note
- 0485 - Max Consecutive Ones
- 0551 - Student Attendance Record I
- 0598 - Range Addition II
- 0628 - Maximum Product of Three Numbers
- 0643 - Maximum Average Subarray I
- 0645 - Set Mismatch
- 0724 - Find Pivot Index
- 0777 - Toeplitz Matrix
- 0837 - Most Common Word
- 0841 - Shortest Distance to a Character
- 0898 - Transpose Matrix
- 0924 - Fair Candy Swap
- 0941 - Sort Array by Parity
- 0958 - Sort Array By Parity II
- 1044 - Find Common Characters
- 1083 - Two Sum Less Than K
- 1098 - Largest Unique Number
- 1319 - Unique Number of Occurrences
- 1363 - Greatest English Letter in Upper and Lower Case
- 1476 - Count Negative Numbers in a Sorted Matrix
- 1482 - How Many Numbers Are Smaller Than the Current Number
- 1580 - Shuffle the Array
- 1741 - Sort Array by Increasing Frequency
- 2102 - Find the Middle Index in Array
- 2331 - Intersection of Multiple Arrays
- 2614 - Maximum Count of Positive Integer and Negative Integer
- 2624 - Difference Between Element Sum and Digit Sum of an Array
- 2634 - Minimum Common Value
- 2639 - Separate the Digits in an Array
- 2654 - Count the Number of Vowel Strings in Range
- 2737 - Row With Maximum Ones
- 3034 - Points That Intersect With Cars
- 3207 - Make Three Strings Equal
- 3429 - Special Array I
- 3581 - The Two Sneaky Numbers of Digitville
- 3859 - Maximum Product of Two Digits
- 2902 - Max Pair Sum in an Array
- 1127 - Last Stone Weight
- 2316 - Count Hills and Valleys in an Array
- 1241 - Decompress Run-Length Encoded List
- 1302 - Delete Characters to Make Fancy String
- 2032 - Largest Odd Number in String
- 2058 - Concatenation of Array
- 2542 - Average Value of Even Numbers That Are Divisible by Three
- 2767 - Maximum Sum With Exactly K Elements
- 2361 - Calculate Digit Sum of a String
- 2756 - Buy Two Chocolates
- 3172 - Divisible and Non-divisible Sums Difference
- 1039 - Find the Town Judge
- 1916 - Find Center of Star Graph
- 2121 - Find if Path Exists in Graph
- 0070 - Climbing Stairs
- 0171 - Excel Sheet Column Number
- 0268 - Missing Number
- 0476 - Number Complement
- 1289 - Day of the Week
- 1920 - Determine Color of a Chessboard Square
- 3055 - Maximum Odd Binary Number
- 3371 - Harshad Number
- 0762 - Find Anagram Mappings
- 1074 - High Five
- 1082 - Sum of Digits in the Minimum Number
- 2442 - Number of Arithmetic Triplets
- 0003 - Longest Substring Without Repeating Characters
- 0016 - 3Sum Closest
- 0018 - 4Sum
- 0031 - Next Permutation
- 0034 - Find First and Last Position of Element in Sorted Array
- 0073 - Set Matrix Zeroes
- 0080 - Remove Duplicates from Sorted Array II
- 0090 - Subsets II
- 0209 - Minimum Size Subarray Sum
- 0287 - Find the Duplicate Number
- 0324 - Wiggle Sort II
- 0487 - Max Consecutive Ones II
- 0658 - Find K Closest Elements
- 2868 - Continuous Subarrays
- 3241 - Divide Array Into Arrays With Max Difference
- 0159 - Longest Substring with At Most Two Distinct Characters
- 0165 - Compare Version Numbers
- 0187 - Repeated DNA Sequences
- 0340 - Longest Substring with At Most K Distinct Characters
- 0395 - Longest Substring with At Least K Repeating Characters
- 0438 - Find All Anagrams in a String
- 0616 - Add Bold Tag in String
- 0760 - Bold Words in String
- 2487 - Optimal Partition of String
- 0012 - Integer to Roman
- 1359 - Circular Permutation in Binary Representation
- 1585 - The kth Factor of n
- 1674 - Minimum Operations to Make Array Equal
- 0133 - Clone Graph
- 0207 - Course Schedule
- 0210 - Course Schedule II
- 0261 - Graph Valid Tree
- 0277 - Find the Celebrity
- 0310 - Minimum Height Trees
- 0323 - Number of Connected Components in an Undirected Graph
- 0511 - All Paths from Source Lead to Destination
- 0444 - Sequence Reconstruction
- 0505 - The Maze II
- 0684 - Redundant Connection
- 0744 - Network Delay Time
- 0803 - Cheapest Flights Within K Stops
- 0813 - All Paths From Source to Target
- 0820 - Find Eventual Safe States
- 0871 - Keys and Rooms
- 0881 - Loud and Rich
- 0922 - Possible Bipartition
- 0984 - Most Stones Removed with Same Row or Column
- 1100 - Connecting Cities With Minimum Cost
- 1101 - Parallel Courses
- 1120 - Flower Planting With No Adjacent
- 1229 - Shortest Path with Alternating Colors
- 1442 - Number of Operations to Make Network Connected
- 2035 - Count Sub Islands
- 2090 - Number of Ways to Arrive at Destination
- 3677 - Maximum Amount of Money Robot Can Earn
- 0269 - Alien Dictionary
- 0329 - Longest Increasing Path in a Matrix
- 0332 - Reconstruct Itinerary
- 0499 - The Maze III
- 0685 - Redundant Connection II
- 0754 - Cracking the Safe
- 0770 - Couples Holding Hands
- 0863 - Sum of Distances in Tree
- 0877 - Shortest Path Visiting All Nodes
- 2439 - Longest Cycle in a Graph
- Blog - Blog-related coding challenges
- Load Balancer - Load balancer implementation
- Netcat - Network utility implementation
- Notion - Notion-related projects
- Smallest Common Scroll - Scroll optimization challenge
Each problem directory contains:
README.md- Problem description and examples- Solution file(s) in various languages (JavaScript, Python, etc.)
To run a solution, navigate to the problem directory and execute the appropriate file.