Opening the reading…
Opening the reading…
PROGRAMMING FUNDAMENTALS › JAVA FUNDAMENTALS
This is a scratch drill — your code runs, nothing is graded or recorded. No test cases, no expected output, no verdict.
TASK
Replace the incorrect rightmost-value swapping approach with an in-place compaction pass followed by a zero-filling pass. Transform [0, 5, 0, 2, 8, 0] into [5, 2, 8, 0, 0, 0] without changing the order of 5, 2, and 8.
OUTPUT
Sample5 2 8 0 0 0
What a finished answer prints, from the lesson. Nothing has run yet — press Run and this is replaced by your program’s own output.