loading...

re: Daily Challenge #193 - What's the Real Floor? VIEW POST

FULL DISCUSSION
 

Rust pattern matching

fn get_real_floor(n: i32) -> i32 {
    match n {
        0 => 0,
        1..=12 => n-1,
        13..=std::i32::MAX => n - 2,
        _ => n
    }
}
Code of Conduct Report abuse