Check that the right hand side of the Increment/Assignment Operator doesn't include the Variable before spending hours debugging why numbers are so big
When you change a[i] = a[i] + 1 to a[i] += 1 make sure you remove the second a[i] otherwise you will be left with a[i] += a[i] + 1 which will be interpreted as a[i] = a[i] + a[i] + 1
Written by Mike Dalton
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Increment operator
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#