Ex9 6

$\def\abs#1{|#1|}\def\i{\mathbf {i}}\def\ket#1{|{#1}\rangle}\def\bra#1{\langle{#1}|}\def\braket#1#2{\langle{#1}|{#2}\rangle}\def\tr{\mathord{\mbox{tr}}}\mathbf{Exercise\ 9.6}$

Suppose $P: \{0,\dots, N-1\} \to \{0,1\}$ is zero except at $x = t$, and suppose we are given not only a quantum oracle $U_P$, but also the information that all suffixes except $010$ and $100$ have been ruled out. In other words, the solution $t$ must end with either $010$ and $100$. Exhibit an algorithm that finds the solution with fewer calls to $U_P$ than Grover's algorithm.