When can the hands swap places and still show a real time?
Take an analogue clock at some moment and imagine swapping its two hands: the hour hand takes the minute hand's position and vice versa. Usually the result is nonsense: no real time has the hands there. But occasionally the swapped picture is itself a genuine time.
How many moments in a 12-hour period have this property? Count moments when the hands coincide too, since swapping then changes nothing.
Show a hint
Measure each hand's position as a fraction of a full turn. If the real time is x hours, the hour hand is at x/12 of a turn and the minute hand at the fractional part of x. Write down what it means for the swapped picture to be a valid time y, and combine the two conditions.
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.