Please help me to debug where my 1st test case is failing

Code - https://ide.codingblocks.com/s/246213

since n and w can be 1000 so increase your array sizes to atleast 1001
corrected code :- https://ide.codingblocks.com/s/246224

In case of any doubt feel free to ask :slight_smile:
mark your doubt as resolved if no further queries

Such a minute mistake. Thanks!