RE in Binary Concatenation

Have a look at my code.
https://www.codechef.com/viewsolution/35999369
I don’t know why I’m getting RE. Please tell me where did I miss.

Use try catch … btw you have to sort the arraylist in reverse order to get max in 0th position.

I did the same and now I’m getting WA .

Max find karna he…sort the arraylist in reverse order to get max in 0th position.