Given a number check whether it is a mystery number or not. A mystery number is that number which can be expressed as sum of two numbers and those two numbers should be reverse of each other.
Input : n = 121
Output : 29 92
Input : n = 22
Output : 11 11
Source :Paytm Interview Set 23
The idea is to try every possible pair smaller than or equal to n.
Below is the implementation of above approach.
- Check if the binary representation of a number has equal number of 0s and 1s in blocks
- Check if a number is divisible by all prime divisors of another number
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Program to check whether a number is Proth number or not
- Check if a number with even number of digits is palindrome or not
- Check whether the given number is Euclid Number or not
- Check if a number is an Achilles number or not
- Check whether a number is Non-hypotenuse number
- Check if a number is a power of another number
- Check if given number is Emirp Number or not
- Check Whether a number is Duck Number or not
- Check if a number is a Krishnamurthy Number or not
- Check if a number is Triperfect Number
- Check if a number is an Unusual Number or not
- How to check if a given number is Fibonacci number?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.