#K57322. Count the Tallest Candles
Count the Tallest Candles
Count the Tallest Candles
You are given an array of integers representing the heights of candles on a birthday cake. Your task is to determine how many of the candles are the tallest. In other words, if the maximum height among the candles is \(H=\max_{1\leq i\leq n} h_i\), count the number of candles such that \(h_i = H\).
For example, if the candle heights are [3, 2, 1, 3], then the tallest height is 3, and there are 2 candles of that height, so the answer is 2.
inputFormat
The input is read from standard input (stdin) and consists of two lines:
- The first line contains an integer \(n\), the number of candles.
- The second line contains \(n\) space-separated integers, where each integer represents the height of a candle.
You may assume that \(0 \leq n \leq 10^5\) and each height is a positive integer.
outputFormat
Output to standard output (stdout) a single integer representing the number of candles that have the maximum height.
## sample1
5
1