You are viewing a single comment's thread. Return to all comments →
They are just asking the count of candles blow off by birthday guy.
Only heighted candles can be blow off , so we just need to find the count of heighted candles from array.
a) Sort the array in ascending order , so you will have the sorted array with high values as last
b) Get the last value in array and find out the count with that value. Thats it.
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 →
They are just asking the count of candles blow off by birthday guy.
Only heighted candles can be blow off , so we just need to find the count of heighted candles from array.
a) Sort the array in ascending order , so you will have the sorted array with high values as last
b) Get the last value in array and find out the count with that value. Thats it.