CT1381

The Missing Mark of Briarthorn

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Every season at the forest village of Briarthorn, someone must verify the safety inspections. This year the task falls to Chetan, armed only with the coins register. 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 <= 38; values are distinct in [1,n].

Example 1:

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

Example 2:

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

Example 3:

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

Constraints:

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

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