You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
elif rotateArray[mid] == rotateArray[front] and rotateArray[front] == rotateArray[rear]:
for i in range(1, len(rotateArray)):
if rotateArray[i] < minVal:
minVal = rotateArray[i]
rear = i
这一段代码,mid,front,rear的值都一样之后,遍历整个数组找出最小值了,应该就直接return吧,怎么又进循环了。这里又多循环几次,切到只剩两个数了才出循环,不是做白工了吗。第一次就已经在整个list里遍历了一遍,找出最小值了,再循环没意义啊。
The text was updated successfully, but these errors were encountered: