You are viewing a single comment's thread. Return to all comments →
fn birthdayCakeCandles(candles: &[i32]) -> i32 { if candles.is_empty() { return 0; } let mut counter = 0; let mut high_number = candles[0]; for &i in candles { if i > high_number { counter = 1; high_number = i; } else if i == high_number { counter += 1; } } counter }
Seems like cookies are disabled on this browser, please enable them to open this website
Birthday Cake Candles
You are viewing a single comment's thread. Return to all comments →
Rust