103. Flag Duplicate Rows by Subset

Medium

Return a boolean Series, aligned to df's index, flagging rows that are duplicates of another row when considering only the club and age columns. For each set of duplicates, treat the last occurrence as the original (False) and flag all earlier occurrences as duplicates (True).

Sample data: df:

  club  age name
0    A   24    P
1    A   24    Q
2    A   23    R
3    B   30    S
4    B   30    T
Implement solve(...)