
Given an array
nums, write a function to move all0‘s to >the end of it while maintaining the relative order of the >non-zero elements.For example, given
nums = [0, 1, 0, 3, 12], after calling >your function,numsshould be[1, 3, 12, 0, 0].
题意:
给一组数,把0都移动到数组后方。
1 |
class Solution { |




近期评论