You are viewing a single comment's thread. Return to all comments →
Here's my Simple soln in C++ : O(n)
int birthdayCakeCandles(vector<int> candles) { int max = 0; int count = 0 ; for (int i=0; i<candles.size(); i++) { if(candles[i]>max){ max = candles[i] ; count=1 ; } else if(candles[i]==max){ count ++ ; } } return 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 →
Here's my Simple soln in C++ : O(n)