Not working for Java - Waste of time


#1

For the given case of 2 ab bb - Working fine in my local but throwing error in current compiler. The issue seems to be with the arraylist being empty