Easy solution
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+
# 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        int n=nums.size();\n        for(auto it: mp)\n        {\n            int num=it.first;\n            vector<int>& indices=it.second;\n            int maxi=0;\n            for(int i=0;i<indices.size()-1;i++)\n            {\n                 maxi=max(maxi,(indices[i+1]-indices[i])/2);\n            }\n            maxi=max(maxi,(n-indices.back()+indices[0])/2);\n            ans=min(ans,maxi);\n        } \n        return ans;\n    }\n};\n```
['Hash Table', 'C++']