Types: L: int, Q: int, S: str, T_d: List[str]
Ranges: 1 ≤ L ≤ 20, 1 ≤ Q ≤ 1,000,000, S is a length 2^L string, S consists of {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}, T_d is a length L string, T_d consists of {'0', '1', '?'}
Addtl Info: None