✅✔️Short & Easy C++ Solution using MAP || 100%Beat ✈️✈️✈️✈️✈️
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumSeconds(vector<int>& nums) {\n        unordered_map<int,vector<int>>ids;\n        int n = nums.size();\n        for(int i=0; i<nums.size(); i++){\n            ids[nums[i]].push_back(i);\n        }\n        int ans = INT_MAX;\n        for(auto i : ids){\n            vector<int>&v = i.second;\n            int mx = v.front() + n - v.back();\n            for(int j=1; j<v.size(); j++) mx = max(mx,v[j] - v[j-1]);\n            ans = min (ans, mx);\n        }\n        return ans/2;\n    }\n};\n```
['Hash Table', 'C++']