greedy Solution using maps| C++|easy and short code
\n\nclass Solution {\npublic:\n    int minimumSeconds(vector<int>& nums) {\n        vector<int> v;\n        unordered_map<int,int>map;\n        \n        // to 
\n```\nclass Solution {\npublic:\n    int minimumSeconds(vector<int>& nums) {\n        vector<int> v;\n        unordered_map<int,int>map;\n        \n        // to remove circular property repeat the same vector 2 times\n        for(auto i:nums){\n            v.push_back(i);\n        }\n         for(auto i:nums){\n            v.push_back(i);\n        }\n        \n       \n        unordered_map<int,int> um;\n        for(int i=0;i<v.size();i++){\n            if(map.count(v[i]) ){\n                um[v[i]]=(max(um[v[i]],i-map[v[i]]+1));\n                map[v[i]]=i;\n            }else{\n                map[v[i]]=i;\n            }\n        }\n        \n        int ans=1e9;\n        for(auto it:um){\n            ans=min(ans,it.second);\n        }\n        ans-=2;\n        return (ans/2+ans%2);\n    }\n};\n```
['Greedy', 'C++']