CT1029

The Distinct Count at Bloomhaven

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Every season at the tulip beds of Bloomhaven, someone must balance the workshop's books. This year the task falls to Axel, armed only with the coins register. Task: Read n integers and print the number of distinct values. Input format: First line: n. Second line: n space-separated integers. Output format: Print the count of distinct values. Constraints: 1 <= n <= 96; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 93 -81 -25 5 -68 -30 -84 -78 -42 -66 -79 -79 6 6 -1 4 -40 -67 -87 -47 -44 -15 -72 -8 -75 -5 -10 -2 -20 -95 -3 -16 -16 -27 -97 -33 -23 -48 2 -55 6 -18 -48 -42 -54 -58 -50 -73 -89 4 9 -41 -7 -21 -76 -53 -19 -5 -60 9 -68 -55 -81 4 -50 -36 5 -95 -57 -94 -93 -10 -17 -23 -87 -81 -18 -68 -76 -71 -62 -38 -84 1 -9 1 -42 -73 -20 -34 -62 -22 -74 -79
Output: 63

Example 2:

Input: 65 -5 -3 -99 -69 -52 -19 9 -63 -93 -53 -99 -31 -2 -48 -44 -38 -16 6 5 -65 -18 -78 -22 -70 -69 -95 -31 -45 -52 -23 4 -9 -18 -66 -99 -71 -28 -92 -11 -99 5 -95 -55 -42 8 -12 -33 4 -70 -7 -34 -26 -59 0 -70 -46 -6 -20 10 9 -54 -64 -55 -81 -12
Output: 50

Example 3:

Input: 20 -42 -48 5 -62 -39 4 -43 -42 -16 -73 -39 -9 -45 -51 7 -89 -79 -75 -18 -60
Output: 18

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Distinct Count at Bloomhaven - EASY Coding Problem | CodeTikki