You are viewing a single comment's thread. Return to all comments →
Instead of using two loops why not just use one? Like mine:
for(int i=0;i<n;i++) { val=a[i]+a[i+1]; if(val%k!=0) { count++; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Divisible Sum Pairs
You are viewing a single comment's thread. Return to all comments →
Instead of using two loops why not just use one? Like mine: