Pls tell error in this code

@Vaibhav277 read input format carefully,you have to take array input of size W not of n. and take care of cases when array value is -1 as told in the input format.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.