Bug fix - infinite loop in second solution

When {-1,1,-1,1,-1}. Not using [].index method. Not worth it.
The code complexity isn't worth improving performance from best
case O(n) to O(1).