You are viewing a single comment's thread. Return to all comments →
c++ solution
int birthdayCakeCandles(vector candles) { int maxHeight = candles[0]; int contador = 1;
for (int i = 1; i < candles.size(); i++) { if (maxHeight < candles[i]) { maxHeight = candles[i]; contador = 1; } else if (maxHeight == candles[i]) { contador++; } } return contador;
}
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 →
c++ solution
int birthdayCakeCandles(vector candles) { int maxHeight = candles[0]; int contador = 1;
}