Solved Problem 22 in Python