My LeetCode grinding. Trying to do a problem a day.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

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.