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
- Minimum number of integers required such that each Segment contains at least one of them
- Maximize the given number by replacing a segment of digits with the alternate digits given
- Check if a large number is divisible by a number which is a power of 2
- 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 determine focal length of a spherical mirror
- 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 if the number is a Prime power number
- Minimum count of elements required to obtain the given Array by repeated mirror operations
- Segment Tree | Set 1 (Sum of given range)
- Check if a number starts with another number or not
- Check whether a number is Non-hypotenuse number
- Check if given number is Emirp Number or not
- Check whether given number N is a Moran 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 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.