-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Open
Description
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"));
}
}
irfanghat
Metadata
Metadata
Assignees
Labels
No labels