You are viewing a single comment's thread. Return to all comments →
rust
fn bon_appetit(bill: &[i32], k: i32, b: i32) { let _k = k as usize; let out = match bill.iter() .enumerate() .filter_map(|(i, x)| if i != _k {Some(*x)} else {None}) .sum::<i32>() .wrapping_div(2) .wrapping_sub(b) .abs() { 0 => "Bon Appetit".to_string(), x => x.to_string() }; println!("{out}") }
Seems like cookies are disabled on this browser, please enable them to open this website
Bill Division
You are viewing a single comment's thread. Return to all comments →
rust