defshift(N, M, A):""""""if(M % N)==0:return0defloc(count, oldIndex, curIndex, N, M, A):
newIndex =(oldIndex + M)% N
if count == N -1:return0if(newIndex == curIndex)
题目 方法1def shift(N, M, A): """""" if (M % N) == 0: return 0 def loc(count, oldIndex, curIndex, N, M, A): newIndex = (oldIndex + M) % N if count == N - 1: return 0 if (newIndex == curIndex):