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
Rotate the array [4, 2, 7, 1, 3] right by 2 using three inline reversal stages: reverse all five values, reverse the first two values, and reverse the final three values. Print the resulting array as [1, 3, 4, 2, 7].
OUTPUT
Sample1 3 4 2 7
What a finished answer prints, from the lesson. Nothing has run yet — press Run and this is replaced by your program’s own output.