You are viewing a single comment's thread. Return to all comments →
try to use
for( int i = 1 ; i < n ; i++) { lc += a[i-1]; rc -= a[i-1]; if(lc == rc-a[i]) { flag = 0; break; }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Array
You are viewing a single comment's thread. Return to all comments →
try to use
for( int i = 1 ; i < n ; i++) { lc += a[i-1]; rc -= a[i-1]; if(lc == rc-a[i]) { flag = 0; break; }