Python | Hashtable | Max Gap | 570ms beats 94%
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: O(2*n) or O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```py\nclass Solution:\n    def minimumSeconds(self, nums: List[int]) -> int:\n        n = len(nums)\n        maxgap = {}\n        lastoccr = {}\n        for i, x in enumerate(nums):\n            lastoccr[x] = i\n            maxgap[x] = 0\n        for i, x in enumerate(nums):\n            d = i - lastoccr[x]\n            if d <= 0: d += n\n            if d > maxgap[x]:\n                maxgap[x] = d\n            lastoccr[x] = i\n        print(maxgap)\n        return min(maxgap.values()) >> 1\n```
['Python3']