JAVA || Hashing
\nclass Solution {\n    public int minimumSeconds(List<Integer> nums) {\n        HashMap<Integer,List<Integer>> map = new HashMap();\n        for(int i= 0; i < 
```\nclass Solution {\n    public int minimumSeconds(List<Integer> nums) {\n        HashMap<Integer,List<Integer>> map = new HashMap();\n        for(int i= 0; i < nums.size(); i++){\n            int k = nums.get(i);\n            if(map.containsKey(k))\n                map.get(k).add(i);\n            else{\n                map.put(k, new ArrayList());\n                map.get(k).add(i);\n            }\n        }\n        // System.out.println(map);\n        int ans = Integer.MAX_VALUE;\n        for(Map.Entry<Integer,List<Integer>> me : map.entrySet()){\n            int tar = me.getKey();\n            List<Integer> ind = me.getValue();\n            int temp = 0;\n            for( int i = 0 ; i < ind.size(); i++){\n                int cur =0;\n                if(i == ind.size()-1){\n                    cur = ind.get(0)+nums.size() - 1 - ind.get(i);\n                }else{\n                    cur = ind.get(i+1)-ind.get(i)-1;\n                }\n                if(cur%2 != 0)\n                    cur++;\n                cur=cur/2;\n                // System.out.println(cur+" f "+tar);\n                temp = Math.max(cur, temp);\n                \n            }\n            ans = Math.min(ans,temp);\n        }\n        \n        return ans;\n    }\n}\n```
['Java']