Java Solution, Beats 100%, left max and right min approach
\nclass Solution {\n    public int maxChunksToSorted(int[] arr) {\n\t  \n\t      // upvote if you like \n        \n         // Problem based on chaining techniq
```\nclass Solution {\n    public int maxChunksToSorted(int[] arr) {\n\t  \n\t      // upvote if you like \n        \n         // Problem based on chaining technique\n        // First we will create a right minimum array\n        \n        int [] rmin = new int[arr.length+1];\n        rmin[arr.length] = Integer.MAX_VALUE;\n        \n        for(int i=arr.length-1;i>=0;i--)\n        {\n            rmin[i] = Math.min(rmin[i+1], arr[i]);\n        }\n        // traversing through the left maximum array and checking if lmax <rmin  \n        \n        int lmax = Integer.MIN_VALUE;\n            \n        int count = 0;\n        for(int i=0;i<arr.length;i++)\n        {\n            lmax = Math.max(lmax,arr[i]);\n            \n            if(lmax<=rmin[i+1])\n            {\n                count++;\n            }\n        }\n        return count;\n    }\n}\n```
['Java']