For this Question: Mohit has an array of N integers containing all elements from 1 to N, somehow he lost one element from the array.
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.

<b>Constraints:-</b>
1 &le; N &le; 1000
1 &le; elements &le; NPrint the missing elementSample Input:-
3
3 1

Sample Output:
2

Sample Input:-
5
1 4 5 2

Sample Output:-
3, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;



int main(){

int n;
cin>>n;
int a[n-1];
for(int i=0;i<n-1;i++){
    cin>>a[i];
}
sort(a,a+n-1);
for(int i=1;i<n;i++){
    if(i!=a[i-1]){cout<<i<<endl;return 0;}
}
cout<<n;
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?