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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- How to check if a given number is Fibonacci number?
- Check if a number is a power of another number
- Check if a number is a Krishnamurthy Number or not
- Check Whether a number is Duck Number or not
- Check if a number is divisible by all prime divisors of another number
- Check if given number is Emirp Number or not
- Check if a M-th fibonacci number divides N-th fibonacci number
- Check if a number with even number of digits is palindrome or not
- Program to check whether a number is Proth number or not
- Check whether the given number is Euclid Number or not
- Check if the given number is Ore number or not
- Check if a number is an Unusual Number or not
- Check if a number is a Trojan Number
- Check if a number is an Achilles number or not
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Check if a number is Triperfect Number
- Check whether a number is Non-hypotenuse number
- Check if the binary representation of a number has equal number of 0s and 1s in blocks
- Check if a number is Flavius Number
- Check if a given number is factorial of any 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 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.