For this Question: Mohit has an array of N integers containing all elements from a range he selected, but somehow he lost one element from the array (other the first and the last element).
Given N-1 elements your task is to find the missing one.The first line of input contains a single integer N, the next line contains N-1 space- separated integers.

Constraints:-
1 < = N < = 100000
1 < = elements < = 100000

Note:- It is guaranteed that the maximum element - minimum element is equal to N-1 and all the elements will be different.Print the missing integer.Sample Input:-
3
3 5

Sample Output:-
4

Sample Input:-
5
9 13 12 11

Sample Output:-
10, I have written this Solution Code: 
import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		
		int m = sc.nextInt();
long a[] = new long[m];
long sum=0;
long x = 10000000;
long y=0;
for(int i=0;i<m-1;i++){
    a[i]= sc.nextInt();
    if(a[i]<x){
        x=a[i];
    }
    if(a[i]>y){
        y=a[i];
    }
    sum+=a[i];
}
long ans1 = x*(x-1);
ans1/=2;
long ans2 = y*(y+1);
ans2/=2;
long res= ans2-ans1-sum;
System.out.print(res);
   }
	    

}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?