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.
- Check if the binary representation of a number has equal number of 0s and 1s in blocks
- 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 divisible by all prime divisors of another number
- Check if a large number is divisible by a number which is a power of 2
- 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 if the number is a Prime power number
- Check if given number is Emirp Number or not
- Check if a number ends with another number or not
- Check whether the given number is Euclid Number or not
- Check whether a given number N is a Nude Number or not
- Check if a number is an Unusual Number or not
- Check if a number is a power of another number
- Check if a number is Flavius Number
- Check whether a given number is an ugly number or not
- Check Whether a number is Duck Number or not
- Check if a number is an Achilles number or not
- Check if a number is a Trojan Number
- Check whether given number N is a Moran Number or not
- Check if a number is a Krishnamurthy Number or not
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.