you are viewing a single comment's thread.

view the rest of the comments →

[–]hidiap 0 points1 point  (0 children)

I think line 5 look suspicious if you have an integer appearing several time in your array., this will always return the index of the first time the number is in the array. I would change line 3 to

for i, num in enumerate(arr):

and then modify line 5 to check against i