Simple Solution|| HashTable
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```\nclass Solution {\n    public int maxChunksToSorted(int[] arr) {\n        int i,max=0,count=0;\n        Map<Integer,Integer>map1=new HashMap<>();\n        Map<Integer,Integer>map2=new HashMap<>();\n        int nums[]=new int[arr.length];\n        for(i=0;i<nums.length;i++)\n        {\n            nums[i]=arr[i];\n        }\n        Arrays.sort(nums);\n        for(i=0;i<nums.length;i++)\n        {\n            map1.put(nums[i],map1.getOrDefault(nums[i],0)+1);\n            map2.put(arr[i],map2.getOrDefault(arr[i],0)+1);\n            if(map1.equals(map2))\n            {\n                count++;\n                map1.clear();\n                map2.clear();\n            }\n        }\n\n        return count;\n    }\n}\n```
['Hash Table', 'Java']