You are viewing a single comment's thread. Return to all comments →
using functional operations :)
i,j,k = map(int,input().strip().split()) def reversed(n): return int(str(n)[::-1]) def is_beautiful(n): return abs(n - reversed(n)) % k == 0 print(len(list(filter(is_beautiful, range(i,j+1)))))
or two line, unintelligible version :p
i,j,k = map(int,input().strip().split()) print(len(list(filter(lambda n: abs(n - int(str(n)[::-1])) % k==0, range(i,j+1)))))
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Days at the Movies
You are viewing a single comment's thread. Return to all comments →
using functional operations :)
or two line, unintelligible version :p