Since it is given that plane $P_1$ contains $\hat i\:\:and\:\:\hat i+\hat j$,
normal to this plane $=\overrightarrow n_1=\hat i\times(\hat i+\hat j)=\hat k$
Similarly since $P_2$ contains $\hat i-\hat j\:\:and\:\:\hat i+\hat k$,
Normal to $P_2$ =$ \overrightarrow n_2=(\hat i-\hat j)\times (\hat i+\hat k)=-\hat i-\hat j+\hat k$
Also given that $\overrightarrow a$ is parallel to the line of intersection of $P_1$ and $P_2$.
$\Rightarrow\:\overrightarrow a$ is || to $\overrightarrow n_1\times\overrightarrow n_2$
$\overrightarrow n_1\times\overrightarrow n_2=\hat k\times (-\hat i-\hat j+\hat k)=\hat i-\hat j$
$\therefore$ The angle between $\overrightarrow a$ and $(\hat i-2\hat j+2\hat k)$ is given by
$cos\theta=\large\frac{(\hat i-\hat j).(\hat i-2\hat j+2\hat k)}{\sqrt 2.\sqrt 9}$
$=\large\frac{3}{\sqrt 2.3}=\frac{1}{\sqrt 2}$
$\therefore$ The angle $\theta =\large\frac{\pi}{4}$