C++ Solution
Approach\n Describe your approach to solving the problem. \n    Map\n\n# Complexity\n- Time complexity:\n Add your time complexity here, e.g. O(n) \n    O(N)\n\
# Approach\n<!-- Describe your approach to solving the problem. -->\n    Map\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n    O(N)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n    O(N)\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumSeconds(vector<int>& nums) {\n        unordered_map<int, vector<int>> mp;\n        for (int i = 0; i < nums.size(); ++i) mp[nums[i]].push_back(i);\n        int ans = INT_MAX;\n        for (auto [n, pos] : mp) {\n            pos.push_back(pos[0] + nums.size());\n            int ret = 0;\n            for (int i = 1; i < pos.size(); i++) ret = max(ret, (pos[i] - pos[i - 1]) / 2);\n            ans = min(ans, ret);\n        }\n        return ans;\n    }\n};\n```
['C++']