Pergunta de entrevista da empresa Google

Input - string with random question marks for some characters, output - possible combinations of replacing the question marks in the string with 0s and/or 1s.