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 implementation of the above approach.
- Check if a + b = c is valid after removing all zeroes from a, b and c
- Number of trailing zeroes in base B representation of N!
- Count trailing zeroes in factorial of a number
- Smallest number with at least n trailing zeroes in factorial
- Count of N-digit numbers in base K with no two consecutive zeroes
- Removing punctuations from a given string
- Empty an Array by removing maximum of K value from it
- Removing a number from array without changing its arithmetic mean
- Modify string by removing vowels in between two consonants
- K-th smallest element after removing given integers from natural numbers | Set 2
- Reduce the number to minimum multiple of 4 after removing the digits
- Maximize the maximum subarray sum after removing atmost one element
- Removing a number from array to make it Geometric Progression
- Count unique numbers that can be generated from N by adding one and removing trailing zeros
- Build Lowest Number by Removing n digits from a given 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.