Skip to content

Johnny1110/Rust_LeetCode_Journey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rust LeetCode Journey




Weekly leetcode training with Rust, start from 2025/02/20.


Category


Easy


Medium


Hard



Bonus




About Test:

Rust cargo unit test example:


wildcard_matching.rs:

impl Solution {
    pub fn is_match(s: String, p: String) -> bool {
        ...
    }
}

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

    #[test]
    fn test_basic() {
        let s = "abc".to_string();
        let p = "a?c".to_string();
        // Replace false with the correct expected output when implemented.
        assert_eq!(Solution::is_match(s, p), true);
    }

    #[test]
    fn test_edge_case() {
        let s = "".to_string();
        let p = "".to_string();
        assert_eq!(Solution::is_match(s, p), true);
    }
}

cargo cli:

cargo test hard::wildcard_matching

About

weekly leetcode with Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published