How this solution works ? (Gold Mining , LTIME85 , Weak TC ? )

bum+=arr[i];
bum-=arr[i];

This is wrong. It should be bum-=arr[i-p];

1 Like

Sorry for such a silly mistake :sweat_smile:. Thanks a lot :slight_smile: