Solve problem 3 in Swift