#C7262. Day with Maximum Books Borrowed
Day with Maximum Books Borrowed
Day with Maximum Books Borrowed
You are given a list of integers representing the number of books borrowed on each day of a month. Your task is to determine the day (1-indexed) on which the most books were borrowed. In case of a tie (i.e. several days have the same maximum number), output the earliest day.
The solution should read input from standard input (stdin) and print the result to standard output (stdout). The input first contains an integer \(n\) which is the number of days in the month, followed by \(n\) space-separated integers representing the books borrowed per day.
Function Signature: \(\texttt{day_with_max_borrowed}\)
Note: If there are multiple days with the same maximum value \(M\), the day with the smallest index (i.e. the earliest day) should be returned.
inputFormat
The input starts with a single integer (n) ((1 \leq n \leq 10^5)), the number of days. The next (n) integers represent the number of books borrowed on each day, separated by spaces.
outputFormat
Output a single integer, which is the 1-indexed day with the maximum number of books borrowed. If multiple days share the maximum value, output the earliest day among them.## sample
5
10 20 30 40 50
5
</p>