You are viewing a single comment's thread. Return to all comments →
Solved using PHP: Time complexity : O(n)
`$length = count($`candles); `$maxHeight = max($`candles); $candles_count = 0; for( `$i = 0; $`i < `$length; $`i++ ){ if( `$candles[$`i] == $maxHeight ){ $candles_count += 1; } } return $candles_count
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 →
Solved using PHP: Time complexity : O(n)