Task 6 of 11 · 0 solved · 11 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

5.3 Lists — replace first

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

Fill in replaceFirst so that it replaces the element at index 0 with the new value, leaving the rest untouched.

The program prints [new, keep]. Use set, not add.

Your solution