Editorial
Need a hint? Checkout the editorial.
View Editorial
Editorial
If $ p=2 $ then $ p+2=4 $ and $ p^{2}+2p-8=0 $. So $ p=2 $ is not a solution.
If $ p=3 $ then $ p+2=2 $ and $ p^{2}+2p-8=0 $. So $ p=3 $ is a solution.
Now, assume $ p> 3 $, so $ p $ is odd.
We consider two cases. Now you've to solve these two cases by using modular arithmetic