This repository contains my practice for Data Structures and Algorithms using Java.
The goal is to solve LeetCode problems in a structured and repeatable environment instead of solving them only on the website.
If you want to use this setup for practicing LeetCode locally:
git clone https://github.com/tsapkota07/Leetcode-java.git
cd Leetcode-java
source scripts/aliases.shYou can then run problems from the terminal:
lc 1
lc 1 open
lc 1 listProblems are grouped in folders of 100 problems each.
problems/
p0001_0100/
p0001_two_sum/
Solution.java
Runner.java
p0101_0200/
p0128_longest_consecutive_sequence/
Each problem has its own folder containing:
Solution.java— solution written in the same format expected by LeetCodeRunner.java— used for running and debugging the solution locally
Before starting a session:
source scripts/aliases.sh
Commands:
lc 123
Run the runner for problem 123
lc 123 open
Open the folder for problem 123
lc 123 list
Show folders that match problem 123
When solving a problem:
- Review concepts from the notes
- Attempt the problem without hints
- Analyze the solution and write notes about the pattern
Notes.mdcontains general notes and patterns.phase.txtcontains the roadmap for the topics and problems I plan to study.
Build strong understanding of algorithms and data structures through consistent practice.