Simplest || With full Explanation || 100% fast ||  Comment if you have questions
\nclass Solution {\n    public int maxChunksToSorted(int[] arr) {\n        //Basic logic - In a sorted array, at any point maximum number is lesser than the min
```\nclass Solution {\n    public int maxChunksToSorted(int[] arr) {\n        //Basic logic - In a sorted array, at any point maximum number is lesser than the minimum of all the numbers occuring after that. \n        //eg in 1 2 4 7 9 11 15 || (7(max till that point) is less than 9( min till that point)) || (4(max till that point) is less than 7(min till that point))\n        int len = arr.length;\n        int ans = 1;// answer is set to 1 to count the last chunk as well\n        \n        //creating minimum value storing array\n        int minArr[] = new int[len];\n        minArr[len - 1] = arr[len - 1];// filling last value of array\n        for( int i = len - 2; i>= 0; i--){\n            //filling minimum of current(arr[i]) and next minimum (minarr[i+1]) in the array\n            minArr[i] = Math.min(arr[i],minArr[i+1]);\n        }\n        \n        //creating maximum value storing array\n        int maxArr[] = new int[len];\n        maxArr[0] = arr[0];// filling first value of array\n        for( int i = 1; i<len; i++){\n            //filling maximum of current(arr[i]) and previous maximum (maxArr[i+1]) in the array\n            maxArr[i] = Math.max(arr[i],maxArr[i-1]);\n        }\n        \n        for(int i = 0; i<len-1; i++){\n            //using basic logic(given in the start)\n            if(maxArr[i] <= minArr[i+1]) ans++;// if max till that point is less than the min after that point.. //this is chunk\n        }\n        return ans;\n    }\n}\n```
['Java']