C++ | O((n * m) + (m * log(m))) with unordered_map
Approach
Iterate input to store the number of laps done in each sector

To properly calculate the number of sector laps done in a round, we can use the modulus
# Approach
1. Iterate input to store the number of laps done in each sector
    - To properly calculate the number of sector laps done in a round, we can use the modulus operator (%)
    - Throughout the loop, store the maximum number of times that a sector is passed
2. Iterate the unordered_map and retrieve the sectors that match with the maximum number of times that a sector is passed
3. Sort the output vector in increasing order
    - Sorting is needed in this implementation because we cannot guarantee traversal order in unordered_map

# Complexity
n = Number of rounds
m = Number of sectors

- Time complexity: O((n * m) + (m * log(m)))
    - Check code for time complexity notes
    - This is not the most efficient solution to this problem as it can be solved in O(m)
- Space complexity: O(m)
    - We store all sectors to keep track of the number of laps in each sector

# Code
```cpp []
#include <vector>
#include <cstdint>
#include <unordered_map>
#include <algorithm>
#include <functional>

class Solution {
public:
    vector<int> mostVisited(int n, vector<int>& rounds) {
        std::unordered_map<
            uint8_t, // Sector number
            uint8_t  // Sector laps
        > sector_laps = {};
        uint8_t current_sector = rounds[0];
        uint8_t maximum_sector_counter = 0;
        // O(n) to loop rounds
        for (
            uint8_t round = 1;
            round < rounds.size();
            round++
        ) {
            uint8_t sector_counter = 0;
            uint8_t end_sector = rounds[round];
            // O(1) to calculate number of sectors to travel
            if (current_sector <= end_sector) {
                sector_counter = end_sector - current_sector + 1;
            }
            else {
                sector_counter = (n - current_sector + 1) + end_sector;
            }

            // O(m) to loop sectors
            while (sector_counter > 0) {
                // O(1) to insert, find and update unordered_map
                sector_laps[current_sector]++;
                maximum_sector_counter = std::max(
                    maximum_sector_counter,
                    sector_laps[current_sector]
                );
                current_sector %= n;
                current_sector++;
                sector_counter--;
            }
        }
        // Time complexity of above loop is O(n * m) since we can visit all sectors in each round

        std::vector<int> result = {};
        // O(m) to loop sectors
        for (auto iterator : sector_laps) {
            if (iterator.second == maximum_sector_counter) {
                result.push_back(iterator.first);
            }
        }
        // O(m * log(m)) to sort sectors by increasing number
        sort(
            result.begin(),
            result.end(),
            std::less<int>()
        );
        // Total time complexity: O((n * m) + m + (m * log(m))) = O((n * m) + (m * log(m)))
        return result;
    }
};
```
['C++']