You are viewing a single comment's thread. Return to all comments →
My solution in C,passed all test cases..
int main()
{
int n; int k; int count=0; scanf("%d %d",&n,&k); int a[100]; for(int i = 0; i < n; i++) { scanf("%d",&a[i]); } for(int i=0;i<n;i++) { for(int j=i+1;j<n;j++) { if((a[i]+a[j])%k==0) count++; } } printf("%d",count); return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Divisible Pairs Sum
You are viewing a single comment's thread. Return to all comments →
My solution in C,passed all test cases..
int main()
{
}