#K35822. Tallest Building Position
Tallest Building Position
Tallest Building Position
You are given a list of building heights. Your task is to determine the 0-indexed position of the tallest building. If there are multiple buildings with the maximum height, return the index of the first occurrence.
Let \(H = [h_0, h_1, \dots, h_{n-1}]\) be the list of building heights. Find the smallest index \(i\) such that \(h_i = \max\{h_0, h_1, \dots, h_{n-1}\}\).
inputFormat
The input consists of two lines:
- The first line contains a single integer \(n\) (\(1 \leq n \leq 10^5\)), representing the number of buildings.
- The second line contains \(n\) space-separated integers representing the heights of the buildings.
outputFormat
Output a single integer — the 0-indexed position of the tallest building.
## sample1
150
0
</p>