Posts

Showing posts from February 19, 2017

HackerRank-Beautiful Days at the Movies

I just solved this problem in python,so that i want to share with you. Problem: Lily likes to play games with integers and their reversals . For some integer , we define to be the reversal of all digits in . For example, , , and . Logan wants to go to the movies with Lily on some day satisfying , but he knows she only goes to the movies on days she considers to be beautiful . Lily considers a day to be beautiful if the absolute value of the difference between and is evenly divisible by . Given , , and , count and print the number of beautiful days when Logan and Lily can go to the movies. Input Format A single line of three space-separated integers describing the respective values of , , and . Constraints Output Format Print the number of beautiful days in the inclusive range between and . Sample Input 20 23 6   Sample Output 2   Explanation Logan wants to go to the movies on days , , , and . We perform the fol