DEV Community

Discussion on: Daily Challenge #242 - Expressions Matter

Collapse
 
coolshaurya profile image
Shaurya • Edited

My solution using Rust .
Playground

fn expressions_matter(a: u32, b: u32, c: u32) -> u32 {
    let mut all_calculations = [
        a + b + c,
        a * b * c,
        a + b * c,
        (a + b) * c,
        a * b + c,
        a * (b + c),
    ];
    all_calculations.sort();
    all_calculations[5]
}