Solution to difference of squares exercise