This repository contains Java solutions for various LeetCode problems. Each problem is organized in its own module with a complete implementation and README.
- 2. Two Sum
- 75. Sort Colors
- 89. Gray Code
- 273. Integer to English Words
- 303. Range Sum Query - Immutable
- 320. Generalized Abbreviation
- 330. Patching Array
- 350. Intersection of Two Arrays II
- 383. Ransom Note
- 389. Find the Difference
- 401. Binary Watch
- 405. Convert a Number to Hexadecimal
- 476. Number Complement
- 592. Fraction Addition and Subtraction
- 624. Maximum Distance in Arrays
- 633. Sum of Square Numbers
- 650. 2 Keys Keyboard
- 725. Split Linked List in Parts
- 826. Most Profit Assigning Work
- 840. Magic Squares In Grid
- 860. Lemonade Change
- 874. Walking Robot Simulation
- 884. Uncommon Words from Two Sentences
- 945. Minimum Increment to Make Array Unique
- 1038. Binary Search Tree to Greater Sum Tree
- 1051. Height Checker
- 1052. Grumpy Bookstore Owner
- 1122. Relative Sort Array
- 1133. Largest Unique Number
- 1190. Reverse Substrings Between Each Pair of Parentheses
- 1248. Count Number of Nice Subarrays
- 1310. XOR Queries of a Subarray
- 1367. Linked List in Binary Tree
- 1380. Lucky Numbers in a Matrix
- 1382. Balance a Binary Search Tree
- 1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
- 1460. Make Two Arrays Equal by Reversing Subarrays
- 1482. Minimum Number of Days to Make m Bouquets
- 1508. Range Sum of Sorted Subarray Sums
- 1509. Minimum Difference Between Largest and Smallest Value in Three Moves
- 1518. Water Bottles
- 1526. Minimum Number of Increments on Subarrays to Form a Target Array
- 1550. Three Consecutive Odds
- 1552. Magnetic Force Between Two Balls
- 1598. Crawler Log Folder
- 1605. Find Valid Matrix Given Row and Column Sums
- 1634. Add Two Polynomials Represented as Linked Lists
- 1636. Sort Array by Increasing Frequency
- 1684. Count the Number of Consistent Strings
- 1701. Average Waiting Time
- 1716. Calculate Money in Leetcode Bank
- 1791. Find Center of Star Graph
- 1823. Find the Winner of the Circular Game
- 1894. Find the Student that Will Replace the Chalk
- 1945. Sum of Digits of String After Convert
- 2022. Convert 1D Array Into 2D Array
- 2037. Minimum Number of Moves to Seat Everyone
- 2053. Kth Distinct String in an Array
- 2058. Find the Minimum and Maximum Number of Nodes Between Critical Points
- 2125. Number of Laser Beams in a Bank
- 2181. Merge Nodes in Between Zeros
- 2191. Sort the Jumbled Numbers
- 2192. All Ancestors of a Node in a Directed Acyclic Graph
- 2220. Minimum Bit Flips to Convert Number
- 2257. Count Unguarded Cells in the Grid
- 2273. Find Resultant Array After Removing Anagrams
- 2285. Maximum Total Importance of Roads
- 2326. Spiral Matrix IV
- 2418. Sort the People
- 2419. Longest Subarray With Maximum Bitwise AND
- 2582. Pass the Pillow
- 2678. Number of Senior Citizens
- 2683. Neighboring Bitwise XOR
- 2807. Insert Greatest Common Divisors in Linked List
- 3016. Minimum Number of Pushes to Type Word II
- 3217. Delete Nodes From Linked List Present in Array
- 3289. The Two Sneaky Numbers of Digitville
- 3354. Make Array Elements Equal to Zero
- 3370. Smallest Number With All Set Bits
- 3461. Check if Digits Are Equal in String After Operations I
Each problem module contains:
- Problem description link
- Complete Java solution
- Test cases and examples
To run a specific problem:
cd <problem-directory>
./gradlew run