CT423

Steward's Missing Mark Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Steward inherited the aviary at the wren hedges of Thimblewick along with its curious bookkeeping system for stamps. Time to make sense of it. 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 <= 34; values are distinct in [1,n].

Example 1:

Input: 6 4 2 1 6 5
Output: 3

Example 2:

Input: 2 2
Output: 1

Example 3:

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

Constraints:

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

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