Note that ∣z−32∣ is the distance between the point z and (32,0) on argand plane.
Note that ∣z−p2i∣ is the distance between the point z and (0,p2) on argand plane.

∣z−32∣+∣z−p2i∣ is sum of distance of z from A(32,0) and B(0,p2)
For minimising the sum, z should lie on AB and AB should be equal to 52
Now, (AB)2=18+2p2
⇒18+2p2=(52)2
⇒p2=16
i.e. p=±4