All challenges

Saturday, 12 September 2026

Past

Three rungs, one idea. Solving rung 1 counts. Climb as far as you can.

Where Is It

lists + finding positions

Rung 1Daily goal5 points

First place it shows up

Write a function called find_first

Positions in a list are counted from 0. Return the position of the first item equal to wanted, or -1 if it is not in the list at all.

Examples

InputOutput
[3, 7, 7, 9], 71
[], 5-1
[4], 40
[1, 2, 3], 8-1

There are extra hidden tests, so make it work in general, not just for these.

Rung 2Bonus7 points

Every place it shows up

Write a function called find_all

Return a list of all the positions where wanted appears, smallest position first. If it never appears, return an empty list.

Examples

InputOutput
[3, 7, 7, 9], 7[1, 2]
[], 5[]
[4], 4[0]
[1, 2, 3], 8[]

There are extra hidden tests, so make it work in general, not just for these.

Rung 3Bonus10 points

The first one you see twice

Write a function called first_repeat

Walk the list from left to right and return the first value you meet for a second time. In [1, 2, 3, 2, 1] the answer is 2, because the second 2 turns up before the second 1. If nothing repeats, return None.

Examples

InputOutput
[1, 2, 3, 2, 1]2
[1, 2, 3]None
[]None
[4, 4]4

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.