CT2148

Freya's Caramel ingots

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Freya inherited the shed at the cedar groves of Balmcrest along with its curious bookkeeping system for ingots. 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 <= 31; values are distinct in [1,n].

Example 1:

Input: 2 2
Output: 1

Example 2:

Input: 15 13 1 14 11 12 4 2 7 8 6 10 15 9 3
Output: 5

Example 3:

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

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Freya's Caramel ingots - EASY Coding Problem | CodeTikki