My LeetCode grinding. Trying to do a problem a day.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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.