Rust Max Product Of Three
fn max_product_of_three(mut a: Vec<i64>) -> i64 {
    a.sort();
    let c = a.len();

    (a[c - 1] * a[c - 2] * a[c - 3]).max(a[0] * a[1] * a[c - 1])
}

This checks the useful extremes, because the best product can come from either the three largest numbers or two negatives plus one large positive.