public static void main(String[] args) {
        System.out.println(new MaxChunksToMakeSorted2().maxChunksToSorted(new int[] { 5, 1, 1, 8, 1, 6, 5, 9, 7, 8 }));
        System.out.println(new MaxChunksToMakeSorted2().maxChunksToSorted(new int[] { 0, 0, 1, 1, 1 }));
        System.out.println(new MaxChunksToMakeSorted2().maxChunksToSorted(new int[] { 0, 1, 2, 3, 4, 5, 5 }));
        System.out.println(new MaxChunksToMakeSorted2().maxChunksToSorted(new int[] { 2, 3, 2, 2 }));
        System.out.println(new MaxChunksToMakeSorted2().maxChunksToSorted(new int[] { 2, 3, 2, 3, 3 }));
        System.out.println(new MaxChunksToMakeSorted2().maxChunksToSorted(new int[] { 2, 3, 2, 3, 4 }));
        System.out.println(new MaxChunksToMakeSorted2().maxChunksToSorted(new int[] { 2, 3, 2, 4, 3 }));
    }
Why Did you create this class? what does it do?
src/problems/hard/MaxChunksToMakeSorted2.java