LeetCode Exercises with Python

Python version

Introduction

This repository contains a collection of LeetCode exercises, along with detailed explanations and Python code using unittest for testing.

Purpose

The purpose of this repository is to provide a learning resource for Python developers who are practicing their problem-solving skills on LeetCode. Each exercise includes:

  • A clear problem statement from LeetCode.
  • A detailed explanation of the problem and its constraints.
  • A Python implementation of the solution using unittest for testing.
  • A suite of test cases to validate the correctness of the solution.

Structure

The repository is organized into folders, each representing a LeetCode exercise. Within each folder, you'll find:

  • README.md: Contains the problem statement, explanation, and the Python implementation of the solution using unittest.
  • main.py: The Python code for the solution.
  • testing.py: The unittest test cases for the solution.

Usage

To run the test cases for a specific exercise, use the following command:

python3 -m unittest <exercise_folder>.testing

For example, to run the test cases for the "1672_richest_customer_wealth" exercise, use:

python3 -m unittest 1672_richest_customer_wealth.testing

Contributions

Contributions to this repository are welcome! If you'd like to add a new exercise, improve an existing solution, or add more test cases, please feel free to open a pull request.

License

This repository is licensed under the MIT License - see the LICENSE file for details.

Happy Coding And Let's Enjoy Learning Together!