CT897

Xavi's Polished Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Before the gates of the trading post of Goldmeadow close for winter, Xavi must finish the coins ledger - one figure at a time. Task: The array contains n-1 distinct integers chosen from 1..n with exactly one missing. Print the missing integer. Input format: First line: n. Second line: n-1 space-separated distinct integers in [1,n]. Output format: Print the missing integer. Constraints: 2 <= n <= 92; values are distinct in [1,n].

Example 1:

Input: 41 37 40 32 2 26 13 1 38 25 14 21 16 19 23 30 33 3 15 20 17 11 22 28 12 7 35 34 5 29 18 4 6 8 31 39 41 24 10 36 9
Output: 27

Example 2:

Input: 29 19 9 10 14 13 24 2 28 23 26 6 1 27 5 11 22 29 12 4 7 21 8 20 15 17 3 16 25
Output: 18

Example 3:

Input: 20 17 6 12 9 3 16 8 13 10 20 2 18 4 11 7 5 15 1 14
Output: 19

Constraints:

2 <= n <= 92; values are distinct in [1,n].

Loading...
Test Cases:No test cases
No test cases available.