🌟Greedy || 💯Clean Code || 🔥Trick to Convert Circular Array to Singular Array🔥
Connect with me on LinkedIN : https://www.linkedin.com/in/aditya-jhunjhunwala-51b586195/\n# Complexity\n\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n)\
## Connect with me on LinkedIN : https://www.linkedin.com/in/aditya-jhunjhunwala-51b586195/\n# Complexity\n```\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n)\n```\n\n# Code\n## Please Upvote if u found my Solution useful\uD83E\uDD17\n```\nclass Solution {\npublic:\n    int minimumSeconds(vector<int>& nums) {\n        int n = nums.size(), mini = n + 1;\n        vector<int> arr(nums.begin(),nums.end());\n        for(auto it : nums)\n            arr.push_back(it); //Converted circular array to singular array\n        unordered_map<int,vector<int>> mp;\n        for(int i = 0 ; i < n * 2 ; i++)\n            mp[arr[i]].push_back(i);\n        for(auto it : mp){\n            auto vec = it.second;\n            int maxi = 0;\n            for(int j = 0 ; j < vec.size() - 1 ; j++)\n                maxi = max(maxi, (vec[j + 1] - vec[j]) / 2);\n            mini = min(mini, maxi);\n        }\n        return mini;\n    }\n};\n```
['Array', 'Hash Table', 'Greedy', 'C++']