final solution to 6 - sum square difference
updated prob 7