max space of 2 indexes of num and div with 2 and floor result is step to change
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\n# Code\n```javascript []\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar minimumSeconds = function(nums) {\n    let dict = {}\n    let numsLength = nums.length\n    // find indexes of each unique number\n    for (let i = 0; i < numsLength; i++) {\n        if (!dict[nums[i]]) {\n            dict[nums[i]] = []\n        }\n        dict[nums[i]].push(i)\n    }\n    // with 1 unique number need some step to change all element of array to as same as this number\n    let minAllStep = 99999999\n    for (let num in dict) {\n        let indexes = dict[num]\n        // find number of step to change all element of array to as same as num\n        let maxStep = 0\n        for (let index = 0; index < indexes.length; index++) {\n            // with other ways, max space of 2 indexes of num and div with 2 and floor result is step to change\n            let stepCount = Math.floor(((indexes[(index+1)%indexes.length] - indexes[index] + numsLength) % numsLength || numsLength) / 2)\n            if (stepCount > maxStep) {\n                maxStep = stepCount\n            }\n        }\n        // and minStep of all number is result\n        if (maxStep < minAllStep) {\n            minAllStep = maxStep\n        }\n    }\n\n    return minAllStep\n};\n```
['JavaScript']