Missing Element


You are given an array of size n-1, it contains only distinct integers in the range of 1 to n, from which you have to find the element which is missing.

Write a function solve that have the following parameter(s):
1.) arr = array of integers

Example
Input:
arr = [1, 2, 4, 6, 3, 7, 8, 10, 9]
Output:
The function will return,
5

Explanation In first array, numbers from 1 - n the missing element is "5".

Input:
arr = [1, 5, 8, 3, 9, 2, 4, 6, 10]
Output:
The function will return,
7

Explanation
In second array, numbers from 1 - n the missing element is "7".

Constraints
• Number of elements in the array will be greater than or equal to 1 and less than or equal to 1000.
• Every element in the array will be greater than or equal to 1 and less than or equal to 10000.