def beautifulDays(i, j, k):
# Write your code here
cnt = 0
for n in range(i, j + 1):
rn = int(str(n)[::-1])
diff = (n - rn) % k
if not diff:
cnt += 1
return cnt
'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글
[HackerRank-python] Save the Prisoner! (0) | 2022.07.27 |
---|---|
[HackerRank-python] Viral Advertising (0) | 2022.07.26 |
[HankerRank-python] Angry Professor (0) | 2022.07.24 |
[HackerRank-python] Utopian tree (0) | 2022.07.20 |
[HackerRank-python] Designer PDF Viewer (0) | 2022.07.19 |