CT849

Last scrolls of Nandini

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The council of the copper works of Verdigris pays by the answer, and Nandini intends to earn it. First: the full register of scrolls. Task: Read n integers and print the 1-based index of the first occurrence of the maximum value. Input format: First line: n. Second line: n space-separated integers. Output format: Print the 1-based index of the first maximum. Constraints: 1 <= n <= 66; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 24 -100 -47 -29 -15 -12 0 -44 -45 -20 -36 -93 -20 -57 -83 10 -83 -41 -17 -25 -11 -33 -11 -26 -28
Output: 15

Example 2:

Input: 51 -66 -36 10 -98 -38 -57 -91 -53 7 -98 -87 -97 -76 -80 -49 -36 -12 -13 -32 -15 -99 -28 -64 -84 -87 -100 -80 -42 -7 -63 -92 -39 -69 -59 -36 -64 -19 9 5 -71 -10 -40 -86 -32 -80 -97 -68 -12 -18 -95 -11
Output: 3

Example 3:

Input: 43 -52 -6 -86 -83 -42 -20 -72 -22 -21 -78 10 -71 -63 -45 -73 -89 -75 -29 -14 -76 -5 -87 -16 -94 -29 -16 -24 -17 -92 -19 -56 -59 -23 -14 -46 -15 -75 -5 -64 -58 -69 -67 -4
Output: 11

Constraints:

1 <= n <= 66; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Loading...
Test Cases:No test cases
No test cases available.
Last scrolls of Nandini - EASY Coding Problem | CodeTikki