Vector problem(Max Query)

Can you please tell where am I going wrong?

I have been out of practice for a long time