Hi 👋, I'm Chee Hwa and welcome to LeetCode Solutions in Java.
As I'm new to LeetCode and progamming 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
The problem sets and solutions are grouped into Topics as stated in LeetCode.
- Array
- Binary Search
- Bit Manipulation
- Counting
- Dynamic Programming
- Enumeration
- Geometry
- Greedy
- Hash Table
- Heap (Priority Queue)
- Math
- Matrix
- Number Theory
- Prefix Sum
- Simulation
- Sorting
- String
- Two Pointers
# | 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 |
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
29 | Divide Two Integers | Java | Bit Manipulation, Math | ||
371 | Sum of Two Integers | Java | Bit Manipulation, Math | ||
393 | UTF-8 Validation | Java | Array, Bit Manipulation | ||
1342 | Number of Steps to Reduce a Number to Zero | Java | Bit Manipulation, Math | Solution Using Math | |
1486 | XOR Operation in an Array | Java | Bit Manipulation, Math | ||
1680 | Concatenation of Consecutive Binary Numbers | Java | Bit Manipulation, Math, Simulation | Solution Using Math | |
2438 | Range Product Queries of Powers | Java | Array, Bit Manipulation, Prefix Sum |
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
383 | Ransom Note | Java | Counting, Hash Table, String | Solution Using Hash Table |
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
1578 | Minimum Time to Make Rope Colorful | Java | Array, Dynamic Programming, Greedy, String |
# | 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 |
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
593 | Valid Square | Java | Geometry, Math | ||
812 | Largest Triangle Area | Java | Array, Geometry, Math |
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
334 | Increasing Triplet Subsequence | Java | Array, Greedy | ||
948 | Bag of Tokens | Java | Array, Greedy, Sorting, Two Pointers | ||
976 | Largest Perimeter Triangle | Java | Array, Greedy, Math, Sorting | ||
1328 | Break a Palindrome | Java | Greedy, String | ||
1578 | Minimum Time to Make Rope Colorful | Java | Array, Dynamic Programming, Greedy, String | ||
2007 | Find Original Array From Doubled Array | Java with Hash Table, Queue or Counting Array | Array, Greedy, Hash Table, Sorting |
# | 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 |
# | 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 | ||
1672 | Richest Customer Wealth | Java | Array, Matrix |
# | 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 |
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
1480 | Running Sum of 1D Array | Java | Array, Prefix Sum | ||
2438 | Range Product Queries of Powers | Java | Array, Bit Manipulation, Prefix Sum |
# | 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 |
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
948 | Bag of Tokens | Java | Array, Greedy, Sorting, Two Pointers | ||
976 | Largest Perimeter Triangle | Java | Array, Greedy, Math, Sorting | ||
1337 | The K Weakest Rows in a Matrix | Java | Array, Binary Search, Heap (Priority Queue), Matrix, Sorting | Solution Using Heap (Priority Queue) | |
1679 | Max Number of K-Sum Pairs | Java | Array, Hash Table, Sorting, Two Pointers | Solution Using Hash Table | |
2007 | Find Original Array From Doubled Array | Java with Hash Table or Queue | Array, Greedy, Hash Table, Sorting | Solution Using Counting Array |
# | Problem | Solution | Difficulty | Topics | Note |
---|---|---|---|---|---|
12 | Integer to Roman | Java | Hash Table, Math, String | ||
13 | Roman to Integer | Java | Hash Table, Math, String | Solution Using Hash Table | |
151 | Reverse Words in a String | Java with String or Collections Implementations | String, Two Pointers | Solution Using Two Pointers | |
344 | Reverse String | Java | String, Two Pointers | ||
383 | Ransom Note | Java with Counting Array or Hash Table | Counting, Hash Table, String | ||
412 | Fizz Buzz | Java | Math, Simulation, String | ||
609 | Find Duplicate File in System | Java | Array, Hash Table, String | ||
929 | Unique Email Addresses | Java | Array, Hash Table, String | ||
1071 | Greatest Common Divisor of Strings | Java | Math, String | ||
1154 | Day of the Year | Java | Math, String | ||
1328 | Break a Palindrome | Java | Greedy, String | ||
1578 | Minimum Time to Make Rope Colorful | Java | Array, Dynamic Programming, Greedy, String | ||
1592 | Rearrange Spaces Between Words | Java | String | ||
1832 | Check if the Sentence is Pangram | Java | Hash Table, String | Solution Using Hash Table | |
1935 | Maximum Number of Words You Can Type | Java | Hash Table, String | ||
2315 | Count Asterisks | Java | String |
# | 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 | ||
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 |