Hi guys!
When testing my homework i noticed that when the function reaches the lasts indexes of the list, it starts over. Indeed, it "scans" the same items multiple times . In particular, this for loop works on the range of the length of the list of integers; but under precise condition, the list is reduced. I want to reduce the for loop accordingly to the trend of the function, but I don't know if it is possible.
When testing my homework i noticed that when the function reaches the lasts indexes of the list, it starts over. Indeed, it "scans" the same items multiple times . In particular, this for loop works on the range of the length of the list of integers; but under precise condition, the list is reduced. I want to reduce the for loop accordingly to the trend of the function, but I don't know if it is possible.