You are given an integer n representing the number of sectors on a circular track, sequentially numbered from n in clockwise order. You are also given an integer array rounds that defines the sequence of checkpoints in a marathon held on this track.
The marathon begins at sector rounds[0] and moves in a clockwise direction. For each consecutive pair of checkpoints rounds[i] and rounds[i + 1], the marathon travels clockwise from rounds[i] to rounds[i + 1].
Return an array containing the most frequently visited sectors, sorted in ascending order.
Note: A sector is counted as visited every time the runner passes through it or reaches it as a checkpoint.
Constraints:
n
m
rounds.length
rounds[i] n
rounds[i] rounds[i + 1] for i
You are given an integer n representing the number of sectors on a circular track, sequentially numbered from n in clockwise order. You are also given an integer array rounds that defines the sequence of checkpoints in a marathon held on this track.
The marathon begins at sector rounds[0] and moves in a clockwise direction. For each consecutive pair of checkpoints rounds[i] and rounds[i + 1], the marathon travels clockwise from rounds[i] to rounds[i + 1].
Return an array containing the most frequently visited sectors, sorted in ascending order.
Note: A sector is counted as visited every time the runner passes through it or reaches it as a checkpoint.
Constraints:
n
m
rounds.length
rounds[i] n
rounds[i] rounds[i + 1] for i