Python Easy way


  • -1
    W

    def move(x):
    y= []
    z = []
    for i in range(len(x)):
    if (x[i] == 0):
    y.append(0)
    else:
    z.append(x[i])
    return(z+y)


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.