This repo contains a collection of leetcode challenges I've completed using Rust.
Each challenge in this repo is organized into a module with tests specific to the module to test for correct results. Each challenge also has a README that explains the challenge (similar to how it was described on leetcode), including samples and constraints for the challenge. The list below contains the challenges in this repo.
- two sum
- add two numbers
- longest substring
- longest palindromic substr
- reverse integer
- string to int
- palindrome
- permutations
The leetcode challenges are designed such that your code produces a specific output, such as a vector of integers ( Vec<i32>
), a boolean
or some other value that can be deterministically tested for. Therefore, user experiences, such as typing something at the keyboard and getting a response, are not associated with the challenges. So, to actually run the challenges, you simply need to run the tests that were created for each challenge.
To run all tests, run cargo test
.
To run a specific test, such as the palindrome challenge tests, run cargo test prob_0009_palindrome
.