๐Ÿ“ฆ Ops

Duplicate Requisitions

Stardate 55122.8 ยท UES Magnanimous

Briefing

Ensign Tannenbaum, worried that his requisition for a replacement plasma coupling "might not have gone through", submitted it eleven times. It went through eleven times. Stores now has a list of forty items with a great many repeats and a standing question about whether the Ensign is allowed near forms.

Chief T'Kala wants the list with each item appearing once, keeping the first occurrence in place, so the order stays the order things were asked for. She has been clear that sorting it would be cheating, and that she can tell.

Mission objectives

ARCHIE checks all five every time you run diagnostics.

  • โ€ขRepeats removed, first appearance kept in place
  • โ€ขAn already-unique list is unchanged
  • โ€ขEvery item the same collapses to one
  • โ€ขOrder is preserved, not sorted
  • โ€ขAn empty list stays empty
Ask Commander Raghunathan for a hint

Walk the list keeping a record of what you have already seen (a set is ideal), and only keep an item the first time. Converting to a set and back loses the order, which is the fourth objective.