What must Move Zeroes preserve?
Practice this question from Move Zeroes - Two pointers Pattern Practice Quiz, with options and an explanation.
Question
What must Move Zeroes preserve?
Option A
The order of zero values
Option B — Correct answer
The relative order of non-zero values
Option C
The sorted order of the whole array
Option D
The original positions of all values
Explanation
It must preserve the relative order of all non-zero values.