This repository contains my solutions for LeetCode problems.
LeetCode is a platform featuring coding challenges designed to improve algorithmic thinking and prepare for technical interviews.
Ensure you have Go installed (version 1.24+ is recommended).
Some problems are solved in TypeScript instead. Ensure you have Node.js installed (version 23.6+ is recommended) — Node runs .ts files directly, so no ts-node, tsx, or package.json is needed.
Some problems are solved in Python instead. Ensure you have Python installed (version 3.9+ is recommended).
No additional installation or virtual environments are needed.
To create a new problem structure, use the create_problem.sh script:
./create_problem.sh <number># Go (default)
./create_problem.sh <number> --ts # TypeScript
./create_problem.sh <number> --py # PythonExample:
./create_problem.sh 1
./create_problem.sh 2 --ts
./create_problem.sh 3 --pyThis will create a folder structure (e.g. 0001/) with main.go, main.ts, or main.py as a starter template for the solution, wired up to the shared test runner (see below).
You can run solutions directly:
go run ./0001/main.go
node ./0002/main.ts
python3 ./0003/main.pyReplace the folder number with the specific problem you want to execute.
Each language has a shared test runner in utils/ (RunTests in Go, runTests in TypeScript, run_tests in Python) that takes a list of input/expected-output pairs, runs them against the solution, and prints a single success message if everything passes — or, for each failing case, the input, the expected output, and what was actually returned. Solution files call it directly instead of asserting each case by hand:
utils.RunTests([]utils.TestCase[int]{
{Input: []int{1, 2, 3}, Got: solve([]int{1, 2, 3}), Expected: 0},
})runTests(solve,[{input: [[1,2,3]],expected: 0},])run_tests(Solution().solve, [
{"input": [[1, 2, 3]], "expected": 0},
])To update the progress summary in this README after solving new problems, run the generate_readme.py script:
python3 generate_readme.py