CODE DRILL 2 · RUN ONLY
This is a scratch drill — your code runs, nothing is graded or recorded. No test cases, no expected output, no verdict.
TASK
Implement both ways of summing the array [4, 2, 7, 1]. Print the direct sum and its auxiliary-space label, then print the copy-first sum and its auxiliary-space label.
OUTPUT
SampleDirect sum: 14, auxiliary space: O(1) Copy-first sum: 14, auxiliary space: O(n)
What a finished answer prints, from the lesson. Nothing has run yet — press Run and this is replaced by your program’s own output.