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
PostgreSQLv16

Šeit parādīsies koda izpildes rezultāts

Visible tests
1
Input
20, 23, 6
Expected2
2
Input
13, 45, 3
Expected33
3
Input
1, 9, 1
Expected9
4
Input
10, 20, 2
Expected6
5
Input
100, 100, 1
Expected1
6
Input
10, 20, 1
Expected11
Focus radio
Paused · SomaFM · Fluid