All problems

A Walking Guide Drops the Heading When a Zone Reappears

Level 2 · node · API · Zone headings in actual visit order

Scenario

A fictional botanical garden guide lists stops in walking order. Consecutive stops within the same zone share one heading, but a heading must reappear if the walk leaves and later returns. Some return headings are missing.

Requirements

Return headings in input order. Omit only consecutive repetitions within the same zone; show the heading again after a different zone.

Acceptance criteria

  • Consecutive stops in the same zone share a single heading.
  • A zone heading reappears after visiting a different zone.
  • Distinct zones retain their input order.
  • Return an empty array when there are no stops.