Ruby 3-line solution with detailed explanation (56ms, no extra space)
Solution\n\nrounds[0] > rounds[-1] ?\n    (1..rounds[-1]).to_a + (rounds[0]..n).to_a :\n    (rounds[0]..rounds[-1]).to_a\n\n\n# Explanation\nThere are two obser
# Solution\n```\nrounds[0] > rounds[-1] ?\n    (1..rounds[-1]).to_a + (rounds[0]..n).to_a :\n    (rounds[0]..rounds[-1]).to_a\n```\n\n# Explanation\nThere are two observations which make this problem much simpler:\n1. There are only two numbers which matter: the first one (starting sector) and the last one (finishing sector). All other values can be ignored, because we will visit all sectors on the path anyway.\n2. The number of loops which we make does not matter too. If we make an extra **full** loop, then it will not affect the answer, because we will visit each sector exactly once.\n\n## Case 1. Starting sector <= finishing sector\nNow, let\'s imagine that we have 6 sectors, start at sector 3 and end at sector 5 (remember, all full loops do not matter). \n\nIt will look like this:\n```\nfirst loop:   ..3456\nlast loop:    12345.\nmost visits:    ^^^\n```\n\nHere, you can see that the most visited sectors are all sectors between 3 and 5, because we visit them on the first loop after we start and visit them once again on the last loop before we finish. \n\nSo, in this case the answer is `[start..finish]`.\n\nNote, that it also handles the case when we finish and start at the same sector (e.g. 4):\n```\nfirst loop:   ...456\nlast loop:    1234..\nmost visits:     ^\n```\n\n## Case 2. Starting sector > finishing sector\nThe only exception from this rule is when we start at a sector with **higher** index than the finishing sector, for example we start at 5 and finish at 2:\n```\nfirst loop:   ....56\nlast loop:    12....\nmost visits:  ^^  ^^   \n```\n\nIn this case, the answer would still be all sectors between the starting (5) and finishing section (2), but it now crosses the loop boundary (5 -> 6 -> 1 -> 2), so it needs an extra step to get this. \n\nThe answer can be obtained by concatenating two arrays: `[start..n]` and `[1..finish]`. We need the answer to be in the ascending order, so in order to avoid sorting, let\'s just swap them and return `[1..finish] + [start..n]`.
['Ruby']