Hard Mode: Sifting Engine
Mission 5: Quantum Key Distribution. Part of the Quantum Courier Service, a free course from the Oxford University Quantum Information Society.
You've watched BB84's sifting step in the dress rehearsal. Now build it. Alice and Bob each publicly announce, photon by photon, which basis they used (0 for rectilinear, 1 for diagonal). Any position where their bases don't match gets thrown out.
The job: write solve(alice_bases, bob_bases) that returns the list of indices where the two basis lists agree, i.e. the surviving, sifted-key positions.