Digits on a clock

Write code · Medium · §7.1 Trying them all

A digital clock shows the time as HH:MM, using two digits each for the hour and the minute (for example, 09:05).

Consider every time, one per minute, from 00:00 up to and including h:59 (for example, up to 05:59 when h is 5). Complete the function solution, which returns how many of these times contain the digit d at least once.

Function

solution(h, d)

Constraints

Examples

hdresult
0515
1175

Starter code

def solution(h, d):
    answer = 0
    return answer

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.