Premium problem46. Slice a MultiIndex

Medium Locked

Slice s down to the entries whose first-level label is 'A' or 'B' (i.e. up to and including 'B') and whose second-level label is 5 or greater.

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

A  5     5
   6     6
   7     7
   8     8
   9     9
B  5    15
   6    16
   7    17
   8    18
   9    19
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(...)