Find the Missing Number

Easy

You are given a list of integers nums of size n-1. Each number in nums is unique and lies from 1 to n.

Find the number that is missing from the list.

Example 1
nums: [3, 1, 4]
Answer: 2
Example 2
nums: [1, 2]
Answer: 3

Testing

Input Format

The first line contains an integer ‘T’ denoting the number of test cases.

For each test case, the input has two lines:

  • The first line has a positive integer ‘n’.
  • The second line has n-1 space-separated integers denoting the list nums.

Output Format

For each test case, the output has one line containing the missing number.

Sample Input

2
4
3 1 4
3
1 2

Expected Output

2
3

Constraints

1 <= T <= 100
2 <= n <= 10000

Editorial Link: Editorial