You’re given an array. Move all zeroes to the end without changing the relative order of…
- User
You’re given an array. Move all zeroes to the end without changing the relative order of non-zero elements.
Assistant
Sure! You're given an array and the task is to move all zeroes to the end while keeping the relative order of non-zero elements unchanged.
✅ Example:
Input:
[0, 1, 0, 3, 12]
Output:[1, 3, 12, 0, 0]
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.