public static void main(String args[]){
        int input[] = {5,1,3,1,3,8,3};
        RemoveFromEndToMake2IntoMinGreaterThanMax rme = new RemoveFromEndToMake2IntoMinGreaterThanMax();
        System.out.println(rme.removeFromEnd(input));
        System.out.println(rme.removeFromEndDynamic(input));
    }
http://www.geeksforgeeks.org/remove-minimum-elements-either-side-2min-max/
src/com/interview/dynamic/RemoveFromEndToMake2IntoMinGreaterThanMax.java