Palindromes on a Digital Clock
The puzzle
A 24-hour digital clock shows times from 00:00 to 23:59. A time is palindromic if its four digits read the same forwards and backwards - 21:12, for instance, or 03:30.
How many palindromic times are there in a day?
Stuck?
One at a time, smallest first. Open only as many as you need — the whole point of the puzzle is the part you work out yourself.
Hint 1
If the hours are the digits a and b, the minutes must be b then a.
Hint 2
The minutes must be a real number of minutes, so the first minute digit can be at most 5.
Show the answer Hide the answer
Sixteen.
How to get there
Write the hour as digits a, b. For a palindrome the minutes must be b, a. The constraint is that b, a is a valid minute count, which needs b to be 5 or less; a is unrestricted because any digit is a valid units place.
Hours 00 to 09: b must be 0-5, giving 00:00, 01:10, 02:20, 03:30, 04:40, 05:50 - six. Hours 10 to 19: same six values of b, giving 10:01, 11:11, 12:21, 13:31, 14:41, 15:51 - six more.
Hours 20 to 23: b can only be 0, 1, 2 or 3, all of which are 5 or less, giving 20:02, 21:12, 22:22, 23:32 - four. Total 6 + 6 + 4 = 16. On a 12-hour clock displaying 1:00 to 12:59 the count is different again, which is why the question has to say which clock.
The technique worth keeping
Impose the constraint on the free digits one position at a time, and split the count where the available range changes. Here the hour's tens digit splits the problem into three clean cases.