Beautiful Movie Days
Some days are considered beautiful by a simple number rule. The function beautiful_days receives the range boundaries i and j, plus a number k. For each day, reverse its digits and check whether the absolute difference between the day and its reverse is divisible by k with no remainder. Return how many beautiful days appear from i to j, inclusive.
Примеры
Ввод
20, 23, 6Вывод
2Ввод
13, 45, 3Вывод
33Ввод
1, 9, 1Вывод
9Нужно реализовать
def beautiful_days(i: int, j: int, k: int) -> int:
Теги
math
Entre para ver seu histórico de envios
EntrarEntre para usar o AI Mentor
EntrarVisible tests
1
Input
20, 23, 6Expected
22
Input
13, 45, 3Expected
333
Input
1, 9, 1Expected
94
Input
10, 20, 2Expected
65
Input
100, 100, 1Expected
16
Input
10, 20, 1Expected
11Focus radio
Paused · SomaFM · Fluid