Given two integers a and b, the task is to add them to get c. After that remove zeroes from a, b and c and check for modified values if a + b = c then return “YES” else return “NO”.
Input: a = 101, b = 102
101 + 102 = 203.
After removing all zeroes from a, b and c, a = 11, b = 12 and c = 23
Now check if a + b = c i.e. 11 + 12 = 23 . So print Yes.
Input: a = 105, b = 108
After removing all zeroes a + b!= c, therefore the output is NO.
- Create a function to removeZero from the number n.
- Check if(removeZero(a)+removeZero(b)==removeZero(a+b)) then print YES else print NO
Below is the the implementation of the above approach.
- Check if a + b = c is valid after removing all zeroes from a, b and c
- Smallest number with at least n trailing zeroes in factorial
- Count trailing zeroes in factorial of a number
- Number of trailing zeroes in base B representation of N!
- Removing punctuations from a given string
- Modify string by removing vowels in between two consonants
- Removing a number from array to make it Geometric Progression
- K-th smallest element after removing given integers from natural numbers | Set 2
- Build Lowest Number by Removing n digits from a given number
- Check divisibility by 7
- Check whether a given number is even or odd
- Check n^2 - m^2 is prime or not
- Check if it is possible to move from (a, 0) to (b, 0) with given jumps
- Check if it is possible to move from (0, 0) to (x, y) in N steps
- Check whether product of 'n' numbers is even or odd
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.