terminal
Elevo
/
ESC
Login
Initiate Registration
code
Topics
corporate_fare
Companies
history
History
arrow_back
Back to Challenges
#283
Move Zeroes
Easy
Acceptance 0%
Editorial
description
Problem Description
Given an integer array `nums`, move all `0`'s to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array.
checklist
Constraints
1 <= nums.length <= 10^4
-2^31 <= nums[i] <= 2^31 - 1
science
Examples
Case #1
In:
nums = [0,1,0,3,12]
Out:
[1,3,12,0,0]
Case #2
In:
nums = [0]
Out:
[0]
Mastery Tags
Arrays
Two Pointers
Hiring Companies
Amazon
Apple
Meta
code
Integrated IDE
Python 3
expand_more
C
C++ 17
Java
JavaScript
Python 3
C
C++ 17
Java
JavaScript
Python 3
refresh
class Solution: def moveZeroes(self, nums: list[int]) -> None: pass
Login to Compile
Processing
terminal
Debug Output
home
Home
extension
Practice
robot_2
login
Sign In
account_circle
Menu
code_blocks
Coding
psychology
Aptitude
Navigation
close
Login
Registration