CT1856

The Masthead Missing Mark

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Caravans arrive at the galleon yard of Masthead with crates of ingots, and Kian the auditor must account for every last one. 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 <= 66; values are distinct in [1,n].

Example 1:

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

Example 2:

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

Example 3:

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

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Masthead Missing Mark - EASY Coding Problem | CodeTikki