Given a string str representing a number, the task is to find whether the number is valid or not if it made topsy-turvy i.e upside-down.
Input: str = “1183”
upside-down(1183) = 1183
Input: str = “983”
Approach: Only the digits 1, 3 and 8 are the digits that can form another valid digit when turned upside-down. If the number contains a digit other than these then print No else print Yes.
Below is the implementation of the above approach:
- Count number of bits to be flipped to convert A to B | Set-2
- Program to check if a date is valid or not
- Check if the given Binary Expressions are valid
- Check whether the triangle is valid or not if angles are given
- Check whether Quadrilateral is valid or not if angles are given
- Check if the given Prufer sequence is valid or not
- Check whether right angled triangle is valid or not for large sides
- Find the number of valid parentheses expressions of given length
- Number of valid indices in the permutation of first N natural numbers
- Minimum cells to be flipped to get a 2*2 submatrix with equal elements
- 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
- Check if a number is Flavius 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.