Closed a-gardner1 closed 10 months ago
Two things stick out here:
reversed(enumerate(x))
, so you did enumerate(reversed(x))
and then changed idx
so that it represented the index going the other way, that makes sense. But to get that reversed index, shouldn't you do len(arr)-idx-1
, not len(arr)-idx+1
?