Hashmap based solution || C++ || Greedy
```\nclass Solution {\npublic:\n    int minimumSeconds(vector& nums) {\n        unordered_map>mp;\n        for(int i=0;i<nums.size();i++)\n        {\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++)\n        {\n            mp[nums[i]].push_back(i);\n        }\n        int res=INT_MAX;\n        for(auto j:mp)\n        {\n            int ans=0;\n            int prev=-1;\n            vector<int>v=j.second;\n            for(int i=0;i<v.size()-1;i++)\n            {\n                ans=max(ans,(int)(v[i+1]-v[i])/2);\n            }\n            int t=nums.size()-1-v[v.size()-1]+ v[0];\n            ans=max(ans,(int)(t+1)/2);\n            res=min(ans,res);\n        }\n        return res;\n    }\n};
['Hash Table', 'Greedy', 'C']