GOOD APPROACH
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\nJUST WATCH 10 Minutes of this VIDEO BEFORE READING THE CODE \nhttps://www.youtube.com/watch?v=PFHaErJS864&ab_channel=AanchalJain\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int minimumSeconds(vector<int>& nums) {\n          map<int, pair<int, int>> mp;\n  int n = nums.size();\n  int j = 0;\n  for (int i = 0; i < 2 * n; i++, j++) {\n    if (mp.find(nums[i%n]) == mp.end()) {\n      mp[nums[i % n]] = {j, -1};\n    } else {\n      if (j - mp[nums[i % n]].first >= mp[nums[i % n]].second) {\n        mp[nums[i % n]] = {j, j - mp[nums[i % n]].first};\n      }\n      else {\n        mp[nums[i%n]].first = j;\n      }\n    }\n  }\n  int ans = INT_MAX;\n  for (auto it : mp) {\n    cout << it.first << " ---- " << it.second.second << endl;\n    ans = min(ans, it.second.second);\n  }\n\n  return ans / 2;\n\n    }\n};\n```
['C++']