Wrong output for this question

The result is not being correctly returned for ArrayList implementation in java, please look into it

Click here to start solving coding interview questions