๐Ÿ“ฆ Ops

The Duty Roster

Stardate 55137.3 ยท UES Magnanimous

Briefing

The watch rotation is a list of names, in order, and after the last name it goes back to the first. This is what a rotation is. The current routine, asked who follows the last name on the list, returns nothing, and on two occasions this month the bridge has been unattended for a full shift, during one of which Gerald was, technically, in command.

Chief T'Kala wants: given the roster and the person currently on watch, the next person, wrapping around at the end. If the current person is not on the roster at all, return nothing, because that is a different problem and she wants to hear about it.

Mission objectives

ARCHIE checks all five every time you run diagnostics.

  • โ€ขThe next name in the middle of the roster
  • โ€ขAfter the last name comes the first
  • โ€ขA roster of one wraps to itself
  • โ€ขSomeone not on the roster: nothing
  • โ€ขAn empty roster: nothing
Ask Commander Raghunathan for a hint

Find the position of the current name. If it is not there, return nothing. Otherwise the answer is at position plus one, modulo the length, which is what makes the last one wrap to the first.