India’s Best Job Seekers and Training Platform › Forums › Data Structure › Move Zero's to end
Tagged: Algorithm
-
Given an array of integers, move all zeros present in the array to the end. The solution should maintain the relative order of items in the array.
For example,
Input: { 6, 0, 8, 2, 3, 0, 4, 0, 1 }
Output: { 6, 8, 2, 3, 4, 1, 0, 0, 0 }
Log in to reply.