Skip to content

Implement LeetCode (or similar) exercises in Rustings #2271

@sergiosat92

Description

@sergiosat92

It would be great to add LeetCode-style exercises (or from other competitive programming platforms) into Rustlings so learners can practice Rust by solving real-world algorithmic and data structure problems.

Proposal:

  • Select a curated list of beginner, intermediate, and advanced problems from LeetCode or other platforms.
  • Implement them in the style of Rustlings exercises, with test-driven learning (#[test] failures guiding the user).
  • Keep problems self-contained to avoid licensing issues (rewording original problem statements if necessary). The goal is to take it as a strong reference.

Example exercise:

// TODO: Implement a function that checks if a string is a palindrome
fn is_palindrome(s: &str) -> bool {
    unimplemented!()
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_palindrome() {
        assert!(is_palindrome("racecar"));
        assert!(!is_palindrome("rust"));
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions