Swap Contest Scoreboards
Preview mode. Log in to edit, run, submit, and save progress.
Swap Contest Scoreboards
Two contest objects store their scoreboards as lists of integers. You are given the initial scores for both contests. Create one Contest object for each scoreboard, swap the score lists stored inside the two objects, and return the scoreboards after the swap. The first output line should contain the scores now stored in the first contest, and the second output line should contain the scores now stored in the second contest.
Examples
10 20 30 5 15
5 15
Explanation: After swapping, the first contest stores the second list and the second contest stores the first list.
Approach hint
Create two Contest objects first, one from each input list.
Common mistake
Skipping assumptions, edge cases, or trade-offs can make an otherwise good answer feel incomplete.