Missing Number from 1..n

JavaScript Medium 5 views
Back to Questions

Problem Description

Array has n-1 numbers from 1..n, one number is missing. Find and print it.

Input Format

Line1: n. Line2: n-1 integers.

Output Format

One integer missing.

Sample Test Case

Input:
5 1 2 4 5
Output:
3

Constraints

2

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next