Run Error in 2 test cases

can’t understand what the run errors are in 2 test cases

here is my code https://ide.codingblocks.com/s/303441

@shubhamkumarsingh bro try your code on this input
fcahgdeb
your code is giving stack overflow due to infinite recursion.
So dry run ya code.
Also a piece of advise is simply use Collections.sort on ArrayList.