Meta interview question

1 difficult question of arraylist.