Given a positive number n. The task is to check if the mirror image of the number is equal to given number or not if displayed on Seven Line Segment. A mirror image of a number is a reflected duplication of the number that appears almost identical but is reversed in the direction perpendicular to the mirror surface.
Input : n = 101 Output: Yes Mirror image of 101 is 101 on seven line segment. So, print "Yes". Input : n = 020 Output : No
Observe each digit when displayed on seven line segment, only digit 0, 1, 8 remain same in their mirror image. So, for a number to be equal to its mirror image, it should contain only 0, 1, 8 digits. Also, observe, for two number to be equal their corresponding position digit should be same. Therefore, mirror image should also contain the same digit on their corresponding digit position. So, the number should also be a palindrome.
Below is implementation of this approach:
- Check if number can be displayed using seven segment led
- Maximum number that can be display on Seven Segment Display using N segments
- Find element using minimum segments in Seven Segment Display
- Check if the given string is the same as its reflection in a mirror
- Maximize the given number by replacing a segment of digits with the alternate digits given
- 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
- Program to check whether a number is Proth number or not
- Check if a number with even number of digits is palindrome or not
- Program to determine focal length of a spherical mirror
- Segment Tree | Set 1 (Sum of given range)
- Check if a number is a Trojan Number
- Check Whether a number is Duck Number or not
- Check whether the given number is Euclid Number or not
- Check if a number is an Achilles 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 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.