Tuesday, 29 September 2026
PastThree rungs, one idea. Solving rung 1 counts. Climb as far as you can.
No Repeats
lists + spotting duplicates
Keep the first of each
Write a function called remove_repeats
Return a new list with every number kept only the first time it appears, in the same order. So [1, 2, 1, 3] becomes [1, 2, 3]. An empty list returns an empty list.
Examples
| Input | Output |
|---|---|
| [1, 2, 1, 3] | [1, 2, 3] |
| [] | [] |
| [5] | [5] |
| [2, 2, 2] | [2] |
There are extra hidden tests, so make it work in general, not just for these.
The first one you see twice
Write a function called first_repeat
Read the list from left to right and return the first number you meet for a second time. In [4, 5, 5, 4] that is 5, because the second 5 comes before the second 4. If no number ever appears twice, return None.
Examples
| Input | Output |
|---|---|
| [1, 2, 1, 3] | 1 |
| [1, 2, 3] | None |
| [] | None |
| [4, 5, 5, 4] | 5 |
There are extra hidden tests, so make it work in general, not just for these.
The lonely ones
Write a function called only_once
Return a list of the numbers that appear exactly one time in the whole list, in the order they appear. In [1, 2, 1, 3] only 2 and 3 are alone, so the answer is [2, 3]. If every number appears more than once, return an empty list.
Examples
| Input | Output |
|---|---|
| [1, 2, 1, 3] | [2, 3] |
| [1, 1, 2, 2] | [] |
| [] | [] |
| [5] | [5] |
There are extra hidden tests, so make it work in general, not just for these.
Finish Rung 1 and today counts. Rungs 2 and 3 are there if you want to push further.