Add #24 Python solution