Inverting lists of lists of indices

Jelly, 11 10 bytes

FṀ⁸ċþµJ€x"

Input and output are 1-based.

Try it online! or verify all test cases (0-based for easy comparison).


Pyth, 13 bytes

eMM.ghkSs,RVU

         ,RV      vectorized right map of pair, over:
            UQ      [0, …, len(input) - 1] and
              Q     input
                  (this replaces each date with a [date, type] pair)
        s         concatenate
       S          sort
   .ghk           group by first element (date)
eMM               last element (type) of each sublist

Try it online


Pyth, 14 bytes

ms.e*]k/bdQS{s

Test suite.