My LeetCode grinding. Trying to do a problem a day.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

problem.txt 306B

123456789101112
  1. Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.
  2. Example:
  3. Input: [0,1,0,3,12]
  4. Output: [1,3,12,0,0]
  5. Note:
  6. You must do this in-place without making a copy of the array.
  7. Minimize the total number of operations.