๐Ÿ“ฆ Ops

Inventory Reconciliation

Stardate 55134.1 ยท UES Magnanimous

Briefing

Chief T'Kala has done a physical count of Stores, with a torch, and would like it compared against the computer's idea of Stores. She wants a list of every item where the two disagree, with how far off the computer is: actual minus expected, so a shortfall is negative. Items that agree should not appear at all; she does not need to be told what is fine.

Items in one list but not the other count as zero in the list they are missing from. Ensign Tannenbaum asked whether that was "a bit harsh". The Chief said the torch does not lie.

Mission objectives

ARCHIE checks all five every time you run diagnostics.

  • โ€ขItems that differ, with actual minus expected, sorted by name
  • โ€ขItems that agree are left out entirely
  • โ€ขAn item missing from the actual count is a shortfall of the full amount
  • โ€ขAn item missing from the expected list is a surplus of the full amount
  • โ€ขTwo identical inventories produce nothing
Ask Commander Raghunathan for a hint

Take the union of the names from both sides, look each up with a default of zero, and keep the ones where the numbers differ. Sort by name at the end so the order is stable.