CT2081

The Missing Mark at Firefly Mere

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Lamplighter runs the loft at the lantern lake of Firefly Mere. Today the books show a list of ingots, and the numbers must be worked out before sundown. 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 <= 39; values are distinct in [1,n].

Example 1:

Input: 7 1 5 7 2 4 3
Output: 6

Example 2:

Input: 3 3 1
Output: 2

Example 3:

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

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.