CT2186

Sona's Missing Mark Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Before the gates of the old quarter of Brasshaven close for winter, Sona must finish the scrolls 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 <= 53; values are distinct in [1,n].

Example 1:

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

Example 2:

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

Example 3:

Input: 5 4 1 5 3
Output: 2

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Sona's Missing Mark Ledger - EASY Coding Problem | CodeTikki