Given two integers a and b. Now, c can be found as a + b = c. The task is to check if the equation is still valid after removing all zeroes from a, b and c. If valid then print Yes else print No.
Input: a = 101, b = 102
Current equation is 101 + 102 = 203
After removing 0s, 11 + 12 = 23 (which is still correct)
Input: a = 105, b = 106
105 + 106 = 211
15 + 16 = 211 (Incorrect)
- Calculate c.
- Remove all 0s from a, b and c.
- Check if the new values form a correct equation.
Below is the implementation of the above approach:
Alternate implementation in Python:
- Check whether a + b = c or not after removing all zeroes from a,b and c
- Print string after removing all (“10” or “01”) from the binary string
- Move all zeroes to end of array using List Comprehension in Python
- Find ratio of zeroes, positive numbers and negative numbers in the Array
- Python | Print list after removing element at given index
- Reduce the number to minimum multiple of 4 after removing the digits
- Python | Shift zeroes at end of list
- How to check if a string is a valid keyword in Python?
- Program to check if a date is valid or not
- Check whether triangle is valid or not if sides are given
- Check if the given chessboard is valid or not
- Python | Check whether a string is valid json or not
- Python | Check if string is a valid identifier
- Check if email address valid or not in Python
- Program to generate all possible valid IP addresses from given string
- NLP | Expanding and Removing Chunks with RegEx
- Minimum number of Parentheses to be added to make it valid
- Python | Pandas Series.valid()
- Python | Valid Ranges Product
- Python - Kth Valid String
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.