Hi 👋, I'm Chee Hwa and welcome to LeetCode Solutions in Java.
As I'm new to LeetCode and programming in general, I'm practicing everyday and hope to share my solutions and learnings with you.
- Exclusively on Java
- Beginner problems
- Daily Challenge if within my ability
Date | Problem | Difficulty | Solution | Topics |
---|---|---|---|---|
November 8th | 1544. Make The String Great | Stack | Stack, String | |
November 7th | 1323. Maximum 69 Number | Math or String | Greedy, Math | |
November 6th | 2136. Earliest Possible Day of Full Bloom | Sorting | Array, Greedy, Sorting | |
November 5th | 2131. Longest Palindrome by Concatenating Two Letter Words | Counting or Hash Table | Array, Counting, Greedy, Hash Table, String | |
November 4th | 345. Reverse Vowels of a String | Two Pointers | String, Two Pointers |
The problem sets and solutions are grouped into Topics as stated in LeetCode.
Array
Backtracking
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
1239 | Maximum Length of a Concatenated String with Unique Characters | Java | Array, Backtracking, Bit Manipulation, String | Solution Using Bit Manipulation |
Binary Search
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
1337 | The K Weakest Rows in a Matrix | Java with Heap (Priority Queue) or Sorting | Array, Binary Search, Heap (Priority Queue), Matrix, Sorting | Solution Using Linear Search |
Bit Manipulation
Counting
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
383 | Ransom Note | Java | Counting, Hash Table, String | Solution Using Hash Table | |
2131 | Longest Palindrome by Concatenating Two Letter Words | Java | Array, Counting, Greedy, Hash Table, String | Solution Using Hash Table | |
2351 | First Letter to Appear Twice | Java | Counting, Hash Table, String | Solution Using Hash Table |
Dynamic Programming
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
368 | Largest Divisible Subset | Java | Array, Dynamic Programming, Math, Sorting | ||
1578 | Minimum Time to Make Rope Colorful | Java | Array, Dynamic Programming, Greedy, String |
Enumeration
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
1995 | Count Special Quadruplets | Java | Array, Enumeration | Solution Using Hash Table | |
2240 | Number of Ways to Buy Pens and Pencils | Java | Enumeration, Math | ||
2437 | Number of Valid Clock Times | Java | Enumeration, String |
Geometry
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
593 | Valid Square | Java | Geometry, Math | ||
812 | Largest Triangle Area | Java | Array, Geometry, Math |
Greedy
Hash Table
Heap (Priority Queue)
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
1337 | The K Weakest Rows in a Matrix | Java | Array, Binary Search, Heap (Priority Queue), Matrix, Sorting | Solution Using Sorting |
Math
Matrix
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
766 | Toeplitz Matrix | Java | Array, Matrix | Follow up: One Row at a Time and One Column at a Time | |
835 | Image Overlap | Java with Bit Manipulation or Hash Table | Array, Matrix | ||
1337 | The K Weakest Rows in a Matrix | Java with Heap (Priority Queue) or Sorting | Array, Binary Search, Heap (Priority Queue), Matrix, Sorting | ||
1672 | Richest Customer Wealth | Java | Array, Matrix |
Number Theory
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
1979 | Find Greatest Common Divisor of Array | Java | Array, Math, Number Theory | ||
2413 | Smallest Even Multiple | Java | Math, Number Theory |
Prefix Sum
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
238 | Product of Array Except Self | Java | Array, Prefix Sum | ||
523 | Continuous Subarray Sum | Java | Array, Hash Table, Math, Prefix Sum | ||
560 | Subarray Sum Equals K | Java | Array, Hash Table, Prefix Sum | ||
1480 | Running Sum of 1D Array | Java | Array, Prefix Sum | ||
2438 | Range Product Queries of Powers | Java | Array, Bit Manipulation, Prefix Sum |
Simulation
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
412 | Fizz Buzz | Java | Math, Simulation, String | ||
985 | Sum of Even Numbers After Queries | Java | Array, Simulation | ||
1103 | Distribute Candies to People | Java | Math, Simulation | ||
1680 | Concatenation of Consecutive Binary Numbers | Java with Bit Manipulation or Math | Bit Manipulation, Math, Simulation | ||
2169 | Count Operations to Obtain Zero | Java | Math, Simulation |
Sorting
Stack
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
1544 | Make The String Great | Java | Stack, String |
String
Two Pointers
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
151 | Reverse Words in a String | Java | String, Two Pointers | Solution Using Collections | |
344 | Reverse String | Java | String, Two Pointers | ||
345 | Reverse Vowels of a String | Java | String, Two Pointers | ||
948 | Bag of Tokens | Java | Array, Greedy, Sorting, Two Pointers | ||
1679 | Max Number of K-Sum Pairs | Java | Array, Hash Table, Sorting, Two Pointers | Solution Using Hash Table |