This repository contains Java solutions to selected problems.
Each problem is placed in its own package.
| Title | Solution | Test | Notes |
|---|---|---|---|
| Anagram Checker | AnagramChecker.java | AnagramCheckerTest.java | Case-insensitive comparison using HashMap |
| Group Anagrams | GroupAnagrams.java | GroupAnagramsTest.java | Solved using sorting and character counting |
| Product of Array Except Self | ProductOfArrayExceptSelf.java | ProductOfArrayExceptSelfTest.java | Brute-force and optimized prefix/suffix product approach |
| String To Integer (atoi) | StringToIntAtoi.java | StringToIntAtoiTest.java | Solved without using exceptions; null → NullPointerException. |
| Top K Frequent Elements | TopKFrequentElements.java | TopKFrequentElementsTest.java | Solved using heap-based (PriorityQueue) and bucket sort approaches |
| Two Sum | TwoSumHashMap.java, TwoSumBruteForce.java | TwoSumHashMapTest.java, TwoSumBruteForceTest.java | Solved using HashMap and brute-force approaches |
- Make sure you have JDK 17+ and Maven installed.
- Clone the repository:
git clone https://github.com/maikelsalazar/leetcode-java.git
cd leetcode-java- Run the tests:
mvn test