受大佬启发: https://www.nowcoder.com/discuss/232739 线下跑几个例子暂时没发现问题...记录一下 #消消乐 def gravity(grid,visited): # print('before:',grid) for col in range(5): cnt=0 for row in range(4,-1,-1): if grid[row][col]=='x': cnt+=1 elif cnt>0: ...