Bug in Solution or compilation

Since there is no return type of the function, the value of ‘a’ is to be printed. ‘a’ being an arraylist has [,] brackets and commas in it were as the solution prints only the value in a. Therefore if the answer is correct it still shows incorrect.

Click here to start solving coding interview questions