BMO Financial Group interview question

code with Python to solve clock question