NumPy allowed · plain Python earns 10 bonus points
Cosine-like similarity scores ranked before context assembly
Implement Reciprocal Rank Fusion (RRF), the standard technique production hybrid-search systems use to merge a dense vector-search ranking with a sparse BM25/keyword-search ranking into one final ranking.
Implement reciprocal_rank_fusion(rankings, k=60): for every document, sum 1/(k + rank) across every input ranking it appears in (rank is 1-indexed), then return document IDs sorted by descending total score, ties broken by ascending ID.
reciprocal_rank_fusion(rankings: list[list[int]], k: int = 60) -> list[int]