Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LeetCode Solutions

πŸ“˜ Overview

This repository contains my personal solutions to various LeetCode problems.

The goal is primarily educational. It serves as a place to store my approaches, track my progress, and document different ways to solve algorithmic problems.

Each problem lives in its own folder, with a solution file and its associated tests.

⚠️ Important Notice

If you are currently solving problems on LeetCode, please do not use this repository to complete problems without attempting them yourself first.

Solving problems independently is the best way to learn and improve your problem-solving skills.

These solutions are shared:

  • πŸ“š for learning purposes
  • πŸ” to review different approaches
  • 🧠 to understand alternative implementations
  • πŸ†˜ as a last resort if you are truly stuck

Please try to solve the problem on your own before reading any solution.

🧾 Disclaimer

These solutions represent my personal learning process and may not always be the most optimal or idiomatic approach.

LeetCode often has many creative solutions β€” exploring different implementations is encouraged.

πŸ€– AI Usage

I do not use AI to generate or solve the problem solutions in this repository.

AI is used to generate the test files from the examples provided on the LeetCode problem page. The solution file is never touched.

Extra test cases may also be added by AI when the examples from the problem page don't cover every scenario of the algorithm (e.g. a missing branch or edge case).

For Ruby, this is done via the /write-ruby-test Claude command.

These local tests are only here to help me validate my solutions while working in this repository. They are not necessarily the exact same tests used by LeetCode.

AI is also used to write and maintain the README.md files in this repository.

πŸ—‚οΈ Project Structure

The repository is grouped by language first, then by problem (identified by its LeetCode number and title slug).

leetcode-solutions/
β”œβ”€β”€ README.md
└── ruby/
    β”œβ”€β”€ Gemfile
    β”œβ”€β”€ Gemfile.lock
    β”œβ”€β”€ Makefile
    β”œβ”€β”€ README.md
    β”œβ”€β”€ compose.yaml
    └── 1_two_sum/
        β”œβ”€β”€ main.rb
        └── spec.rb

🧩 Problem Layout

Each problem folder follows a small and consistent structure:

  • one file for the solution
  • one file for the tests

Example:

<language>/<number>_<slug>/
β”œβ”€β”€ solution file
└── test file

File names may vary depending on the language, but the goal stays the same: keep each problem self-contained and easy to navigate.

Language-specific setup and usage notes are documented in each language folder, for example in ruby/README.md.

βž• Adding a New Language

Each language lives in its own top-level directory (e.g. ruby/, typescript/) and follows the same conventions.

Directory structure

<language>/
β”œβ”€β”€ Makefile
β”œβ”€β”€ compose.yaml
β”œβ”€β”€ README.md
└── <number>_<slug>/
    β”œβ”€β”€ main.<ext>        # solution file
    └── spec.<ext>        # test file

Makefile conventions

Every language Makefile must expose the same four targets:

Target Description
make up Start the Docker container
make down Stop the Docker container
make shell Open a shell inside the container
make tests <path> Run the tests for a given path (directory or file)

The tests target should accept both a directory (runs all test files found recursively) and a direct path to a single test file.

README

Each language directory should have its own README.md documenting the setup, how to run tests, and any language-specific notes.

πŸ“œ License

This repository is licensed under the MIT License.

About

Personal LeetCode solutions organized by language, with tests for each problem ✨ β€” try before you peek! πŸ•΅οΈ

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages