// Birthday Cake Candles Hackerrank Solution in C++ Programming
using namespace std;
int main() {
int s=0;
cout << "Enter the size of the array::\n";
cin >> s;
int candles[s];
cout << "\nEnter the " << s << " elements of the array::\n";
int i=0;
while (i<s) {
cin >> candles[i];
i++;
}
// It will calculate the tallest candles from the given array
double max=-INFINITY;
int l=s, counter=0;
while (l--) {
if (candles[l] > max) {
max=candles[l];
}
}
l=s;
while (l--) {
if (candles[l] == max) {
counter++;
}
}
// It will print the final output of the program
cout << "\nTALLEST CANDLES:: " << counter;
return 0;
}