Java solution 100% faster without using Arrays.sort()
\nclass Solution {\n    public int getMaximumConsecutive(int[] coins) {\n      if(coins.length==0 && coins==null)\n          return 0;\n      TreeMap<Integer,In
```\nclass Solution {\n    public int getMaximumConsecutive(int[] coins) {\n      if(coins.length==0 && coins==null)\n          return 0;\n      TreeMap<Integer,Integer> map=new TreeMap<Integer,Integer>();\n      for(int i:coins)\n          map.put(i,map.getOrDefault(i,0)+1);\n      int range=0;\n      for(int i:map.keySet()){\n       if(range==0 && i==1)\n       range=i*map.get(i);\n       else if(range!=0 && range+1>=i)\n         range+=i*map.get(i);\n       else \n        break;\n      }\n     return range+1;\n    }\n}\n```
['Tree', 'Java']