Hard Mode: Superposition Ladder
Mission 1: Enter the Quantum World. Part of the Quantum Courier Service, a free course from the Oxford University Quantum Information Society.
Every basis state in a balanced superposition of n qubits corresponds to a length-n bit string. Some of those strings have exactly as many 1s as 0s, and we call those the balanced strings.
The job: write solve(n) that returns how many length-n binary strings have an equal number of 0s and 1s. If n is odd, that's impossible, so return 0.