Premium problem83. Concatenate Column-Wise with an Outer Join

Medium Locked

Combine df1 and df2 side by side (columns from both, side by side), aligning rows by index label and keeping every index label that appears in either DataFrame, filling with NaN wherever one side has no value for a given label.

Input

df1 =
   x
a  1
b  2
c  3
df2 =
    y
b  10
d  20

Output

     x     y
a  1.0   NaN
b  2.0  10.0
c  3.0   NaN
d  NaN  20.0

Premium problem

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

Implement solve(...)