Challenge
Calculate the strange sum of two natural numbers (also known as lunar addition):
Given \$A=...a_2 a_1 a_0\$ and \$B=... b_2 b_1 b_0\$ two natural numbers written in the decimal base, the strange sum is defined, based on the maximum operation, as: \$A+B=... \max(a_2,b_2) \max(a_1,b_1) \max(a_0,b_0)\$
... a2 a1 a0
+ ... b2 b1 b0
----------------------------------------
... max(a2,b2) max(a1,b1) max(a0,b0)
Input
Two natural numbers
All the following is allowed:
- Zero-padded strings (same length)
- Left-space-padded strings
- Right-space-padded strings
- Array of two padded strings
- 2D space-padded char array
Output
A natural number
Example
1999 + 2018 -> 2999
17210 + 701 -> 17711
32 + 17 -> 37
308 + 250 -> 358
308 + 25 -> 328
Rules
- The input and output can be given in any convenient format (choose the most appropriate format for your language/solution).
- No need to handle negative values or invalid input
- Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
- If possible, please include a link to an online testing environment so other people can try out your code!
- Standard loopholes are forbidden.
- This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.