class Solution {
public int maxChunksToSorted(int[] arr) {
int count = 0;
int max = 0;
for(int i=0;i<arr.length;i++){
for(int j=0;j<=i;j++){
max = Math.max(max,arr[j]);
}
if(max==i) count++;
}
return count;
}
}