Wednesday, July 11, 2018

Beautiful Days at the Movies : Algorithms-Implementation

#The solution in Python is as follows:


i,j,k=map(int,input().split())
l=i
beauty=0
while l<=j:
      a=l
      b=str(a)[::-1]
      c=int(b)
      if (c-a)%k==0:
               beauty+=1
      l+=1
print(beauty)

#Keep visiting for more solutions of HackerRank problems in Python 3.Thank you!!!