Skip to content

Commit

Permalink
Create Missing_Number.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Mukulguptaiit committed Dec 28, 2024
1 parent edc3e7c commit 9281ca0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Missing_Number.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <iostream>
using namespace std;

int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
unsigned long long int t;
cin >> t;
unsigned long long int sum=t*(t+1)/2;
unsigned long long int i=0;
t--;
while (t--) {
cin>>i;
sum-=i;
}
cout<<sum;
return 0;
}

0 comments on commit 9281ca0

Please sign in to comment.