Problems

Find Missing Number

EasyArrays

Given an array of integers from 1 to n, find the missing number. The array is 0-indexed and contains all numbers from 1 to n, except for one. ### Input The first line contains an integer n, the size of the array. The second line contains n-1 space-separated integers.### Output Print the missing number.

Example 1

Input: 5 1 2 4 5

Output: 3

The array is missing the number 3.

Constraints

  • 1 <= n <= 100

Hints

arraymissing number
Find Missing Number | CodeForge AI