Arrays challenges section

i am solving it through Arraylist concept,it is also givving excatly same output as we have instructed in in question,but even then my test cases are getting failed,m unable to figure out

@sameeksha,

Okay. Can you also please share your code?