{"id":26621754,"url":"https://github.com/plugfox/leetcode-rust","last_synced_at":"2026-01-05T08:02:34.731Z","repository":{"id":284069398,"uuid":"953720978","full_name":"PlugFox/leetcode-rust","owner":"PlugFox","description":"🦀 Introduction to Rust","archived":false,"fork":false,"pushed_at":"2025-03-24T01:32:18.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T01:35:35.358Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PlugFox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-24T00:58:13.000Z","updated_at":"2025-03-24T01:00:09.000Z","dependencies_parsed_at":"2025-03-24T01:35:36.915Z","dependency_job_id":"15df11d6-09c3-46b9-b5ed-bccf6002018e","html_url":"https://github.com/PlugFox/leetcode-rust","commit_stats":null,"previous_names":["plugfox/leetcode-rust"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlugFox%2Fleetcode-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlugFox%2Fleetcode-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlugFox%2Fleetcode-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlugFox%2Fleetcode-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PlugFox","download_url":"https://codeload.github.com/PlugFox/leetcode-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245240832,"owners_count":20583102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-24T09:18:27.832Z","updated_at":"2026-01-05T08:02:34.719Z","avatar_url":"https://github.com/PlugFox.png","language":null,"readme":"# 🦀 Rust Leetcode\n\n[![Rust](https://img.shields.io/badge/language-Rust-orange.svg)](https://www.rust-lang.org/)\n[![Rust Book](https://img.shields.io/badge/book-Rust%20Book-blue.svg)](https://doc.rust-lang.org/book/)\n[![Alt Rust Book](https://img.shields.io/badge/book-Improved%20Rust%20Book-blue.svg)](https://rust-book.cs.brown.edu/)\n[![Rustlings](https://img.shields.io/badge/rustlings-Exercises-orange.svg)](https://github.com/rust-lang/rustlings)\n[![Leetcode](https://img.shields.io/badge/leetcode-Questions-blue.svg)](https://leetcode.com/problemset/all/)\n[![License](https://img.shields.io/badge/license-MIT%20License-blue.svg)](https://opensource.org/licenses/MIT)\n\n\nA collection of LeetCode problem solutions implemented in Rust. This repository serves as a learning resource for Rust programming language while solving algorithmic challenges.\n\n## 📋 Repository Structure\n\n```\nleetcode-rust/\n├── bin/                   # Executable Rust files\n│   ├── guessing_game.rs   # Sample guessing game\n│   ├── hello.rs           # Hello world example\n│   └── leetcode.rs        # Main LeetCode runner\n├── data/                  # Test data for LeetCode problems\n│   └── leetcode/\n│       ├── p0001_two_sum.json\n│       └── p0009_palindrome_number.json\n├── src/                   # Source code directory\n│   ├── lib.rs             # Library entry point\n│   └── leetcode/          # LeetCode solutions\n│       ├── problems.rs    # Problem modules registry\n│       └── problems/      # Individual problem solutions\n│           ├── p0001_two_sum.rs\n│           └── p0009_palindrome_number.rs\n└── Cargo.toml             # Rust package configuration\n```\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- [Rust](https://www.rust-lang.org/tools/install) (latest stable version recommended)\n- Cargo (comes with Rust)\n\n### Building the Project\n\n```bash\n# Build the project\ncargo build\n\n# Build with optimizations for release\ncargo build --release\n# or\nmake build\n```\n\n## 🧩 Working with LeetCode Problems\n\n### Directory Structure for Solutions\n\nEach LeetCode problem follows this pattern:\n- Solution code: `src/leetcode/problems/p{number}_{name}.rs`\n- Test data: `data/leetcode/p{number}_{name}.json`\n\n### Adding a New LeetCode Problem\n\n1. Create a new file in `src/leetcode/problems` following the naming convention:\n   ```\n   p{problem_number}_{problem_name_snake_case}.rs\n   ```\n\n2. Implement your solution in the new file:\n   ```rust\n   pub struct Solution;\n\n   impl Solution {\n       pub fn your_method_name(/* parameters */) -\u003e /* return type */ {\n           // Your solution here\n       }\n   }\n\n   #[cfg(test)]\n   mod tests {\n       use super::*;\n\n       #[test]\n       fn test_your_method_name() {\n           // Test cases\n           assert_eq!(Solution::your_method_name(/* test input */), /* expected output */);\n       }\n   }\n   ```\n\n3. Register your solution in `src/leetcode/problems.rs`:\n   ```rust\n   pub mod p{problem_number}_{problem_name};\n   ```\n\n4. Optionally, add test data in `data/leetcode/p{problem_number}_{problem_name}.json`\n\n### Running Tests\n\n```bash\n# Run all tests\ncargo test\n\n# Run tests for a specific problem\ncargo test p0001_two_sum\n\n# Run tests with detailed output\ncargo test -- --nocapture\n```\n\n### Running the LeetCode Solutions\n\n```bash\n# Run the main LeetCode runner\ncargo run --bin leetcode \u003cproblem_number\u003e\n\n# Run a specific example\ncargo run --bin hello\ncargo run --bin guessing_game\n```\n\n## 🧪 Development Workflow\n\n### Available Make Commands\n\n```bash\n# Build the complete pipeline (generate, format, check, test)\nmake all\n\n# Format code\nmake format\n\n# Clean project (remove all build artifacts)\nmake clean\n\n# Run tests\nmake test\n\n# Update dependencies\nmake update\n\n# Check for outdated dependencies\nmake outdated\n\n# Get help on available commands\nmake help\n```\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-solution`)\n3. Commit your changes (`git commit -m 'Add some amazing solution'`)\n4. Push to the branch (`git push origin feature/amazing-solution`)\n5. Open a Pull Request","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplugfox%2Fleetcode-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplugfox%2Fleetcode-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplugfox%2Fleetcode-rust/lists"}