You are viewing a single comment's thread. Return to all comments →
Rust solution:
fn twoArrays(k: i32, A: &mut [i32], B: &mut [i32]) -> String { A.sort(); B.sort(); for (a, b) in A.iter().zip(B.iter().rev()) { if a + b < k { return "NO".to_string(); } } "YES".to_string() }
Seems like cookies are disabled on this browser, please enable them to open this website
Permuting Two Arrays
You are viewing a single comment's thread. Return to all comments →
Rust solution: