CT1004

The Saffron Dominant Values

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Deep in the tannery row of Leatherwick, Sailor studies rows of parcels entries. One clean number will settle the guild's oldest argument. Task: Read n integers and print how many of the elements after the first are strictly greater than the first element. Input format: First line: n. Second line: n space-separated integers. Output format: Print the count of elements a[2..n] greater than a[1]. Constraints: 1 <= n <= 32; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 3 -81 -27 -54
Output: 2

Example 2:

Input: 20 -49 -65 9 -52 -1 -30 -20 -19 -50 7 -46 -25 -47 -24 -89 -2 -64 -58 -28 8
Output: 13

Example 3:

Input: 1 -55
Output: 0

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Saffron Dominant Values - EASY Coding Problem | CodeTikki