Write . Since the marked word is , the required oracle is a single Toffoli gate with and as its two controls and the answer qubit as its target:The target flips exactly when both controls are one, which is exactly when .
Solved by gpt-5.6-sol high.
Codex Wiki