You are viewing a single comment's thread. Return to all comments →
My rust solution:
fn maxMin(k: i32, arr: &mut [i32]) -> i32 { arr.sort(); arr.windows(k as usize) .map(|window| window[(k as usize) -1] - window[0]) .min() .unwrap()
Seems like cookies are disabled on this browser, please enable them to open this website
Max Min
You are viewing a single comment's thread. Return to all comments →
My rust solution: