Solution for problem 6 - Sum square difference