Array exception but why?

following is the question

hello @Muskan-Gupta-598128740703036
ur submission is not accessible to me.
pls use cb ide for ur code sharing