Intermediate
Fuse ranked lists with RRF
Write fuse(rankings), where rankings is a list of lists of passage ids (best first). Give each id 1 / (60 + rank) for every list it is in (rank starts at 1), add the scores, and return the ids as a list, best first.
Ids with equal scores keep the order in which they were first seen.
What Check tests
- An id in two lists rises
- One list stays in order
- No lists gives an empty list
- Ties keep first-seen order
- A top rank beats a lower rank
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
main.py
Sign in to run your code.
Output
Press Run to see what your program prints.