JS solution to berlin clock cata