GeeksforGeeks Solution For Hard Domain .Below You Can Find The Solution Of School Basic ,Easy ,Medium . Or Hackerrank Solution You Can Also Direct Submit Your Solution to Geeksforgeeks Same Problem .You Need to login then you can submit you answers
Problem :- Reverse Coding
Submit Your Solution :- Click Here
Solution :-
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n,m;
cin>>n>>m;
int c=(n*(n+1))/2;
if(c==m)
cout<<1<<endl;
else
cout<<0<<endl;
}
return 0;
}
Output:-
0 Comments: