Given two number l and r. Count the total numbers between l and r which when subtracted from their respective reverse, the difference is a product of k.
Input : 20 23 6 Output : 2 20 and 22 are the two numbers. |20-2| = 18 which is a product of 6 |22-22| = 0 which is a product of 6 Input : 35 45 5 Output : 2 38 and 44 are the two numbers. |38-83| = 45 which is a product of 5 |44-44| = 0 which is a product of 5
Approach: For each number between the given range check if the difference between the number and its reverse number is divisible by k, increment count if yes.
- Absolute difference between the Product of Non-Prime numbers and Prime numbers of an Array
- Counting numbers of n digits that are monotone
- Check if the product of digit sum and its reverse equals the number or not
- Numbers less than N which are product of exactly two distinct prime numbers
- Find N integers with given difference between product and sum
- Absolute difference between sum and product of roots of a quartic equation
- Find an index such that difference between product of elements before and after it is minimum
- Print prime numbers from 1 to N in reverse order
- Check whether product of 'n' numbers is even or odd
- Find two numbers with sum and product both same as N
- Sort the numbers according to their product of digits
- Product of all the Composite Numbers in an array
- Number of digits in the product of two numbers
- Find the Product of first N Prime Numbers
- Find if n can be written as product of k numbers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Mithun Kumar