Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 4.22 KB

File metadata and controls

32 lines (24 loc) · 4.22 KB

LeetCode Solutions in Java

This repository contains Java solutions to selected problems.

Structure

Each problem is placed in its own package.

Solved Problems

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

Testing

  1. Make sure you have JDK 17+ and Maven installed.
  2. Clone the repository:
git clone https://github.com/maikelsalazar/leetcode-java.git
cd leetcode-java
  1. Run the tests:
mvn test