ARRQRY PROBLEM

I have attached my coding for this particular problem statement. I can’t find any errors,bugs etc…however it shows WA.