HI All, I was solving this problem TLG. The method mentioned in the editorials involves creating 3-4 arrays and then calculating the answer. I am trying a different approach where the lead is calculated during the input of the scores and then compared with the previous lead. I am getting the desired output in my IDE however there seems to be some test case that I am missing because of which I am getting wrong answer at the codechef compiler. Please help in pointing out the mistake in my approach. Here is my code:

```
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
int b[n];
int p1,p2;
int diff,ans,player;
ans = 0;
p1 = p2 = 0;
for(int i=1;i<=n;i++)
{
cin>>a[i];
cin>>b[i];
p1 += a[i];
p2 += b[i];
diff = abs(a[i] - b[i]);
if(diff > ans)
{
ans = diff;
player = (p1 > p2)?1:2;
}
//cout<<p1<<" "<<p2<<endl;
}
cout<<player<<" "<<ans<<endl;
return 0;
}
```