Generate All Binary String Expansions with Wildcard '?'
Write an iterative approach for the given binary string with wildcard "?" where the wildcard can be replaced with 0 or 1. Return all permutations by replacing the wildcard character e.g. "0?" -> "00", "01" "0?1" -> "001", "011" "0??1" -> "0001", "0011", "0101", "0111" With the interviewer's hint, solved using the BFS.
Asked at:
Bloomberg
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late July, 2025
Bloomberg
Senior
Hello Interview Premium
Your account is free and you can post anonymously if you choose.