NumPy allowed · plain Python earns 10 bonus points
Cosine-like similarity scores ranked before context assembly
Implement sign-based binary quantization, a cheap first-pass filter real vector databases use before exact re-ranking.
Implement binary_quantize_hamming(a, b). Quantize each vector to a bit per dimension (1 if the component is >= 0, else 0), then return the Hamming distance (count of differing bits) between the two quantized vectors.
binary_quantize_hamming(a: list[float], b: list[float]) -> int