Skip to content

sarvex/rust-leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust LeetCode Solutions

A comprehensive collection of LeetCode problem solutions implemented in Rust.

Overview

This repository contains Rust solutions for over 500 LeetCode problems. Each solution is implemented with a focus on:

  • Clean, idiomatic Rust code
  • Detailed documentation and comments
  • Optimal time and space complexity
  • Test cases where applicable

Repository Structure

Solutions are organized by problem number and title:

  • 0001.Two Sum.rs
  • 0002.Add Two Numbers.rs
  • etc.

Each file contains:

  • The solution implementation
  • Documentation comments explaining the approach
  • Time and space complexity analysis (in most solutions)
  • Test cases for validation

Usage

These solutions can be used as:

  • Reference for learning Rust programming patterns
  • Study material for algorithm and data structure concepts
  • Preparation for coding interviews
  • Examples of idiomatic Rust code

Getting Started

To run any solution locally:

  1. Make sure you have Rust installed (https://www.rust-lang.org/tools/install)
  2. Create a new Rust project: cargo new leetcode_solution
  3. Replace the content of src/main.rs with the solution code
  4. Add any necessary dependencies to Cargo.toml
  5. Run with cargo run

Contributing

Contributions are welcome! If you'd like to add a new solution or improve an existing one:

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

License

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

Acknowledgments

  • Thanks to LeetCode for providing the problems
  • The Rust community for creating such an amazing language

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages