Premium problem49. Swap and Sort Index Levels

Medium Locked

Exchange the levels of the MultiIndex so the index is (numbers, letters), then ensure it is sorted. Return the new Series.

Input

A  0     0
   1     1
   2     2
   3     3
   4     4
        ..
C  5    25
   6    26
   7    27
   8    28
   9    29
Length: 30, dtype: int64

Output

0  A     0
   B    10
   C    20
1  A     1
   B    11
        ..
8  B    18
   C    28
9  A     9
   B    19
   C    29
Length: 30, dtype: int64

Premium problem

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

Implement solve(...)