Add #39 Python solution