Premium problem77. Add Two Series with a Fill Value

Medium Locked

Add s1 and s2 element-wise, aligning by index. For a label that exists in only one of the two Series, treat the missing side as 0 instead of producing NaN.

Input

s1 =
a    1
b    2
c    3
dtype: int64
s2 =
b    10
c    20
d    30
dtype: int64

Output

a     1.0
b    12.0
c    23.0
d    30.0
dtype: float64

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)