Array wave print

getting test case 0 wrong and test case 2 run error

@Rakshitgarg99
looking into it

1 Like

@Rakshitgarg99
hello Rakshit,
you code is working fine can u please resubmit it

image

1 Like


look on this one also:))

@Rakshitgarg99
declare ur array as int arr[m+1][n+1];

and enjoy the green tick :sunglasses::sunglasses:
image

1 Like

please tell the reason for m+1 and n+1.
thanks for help :smile:

@Rakshitgarg99
if we declare an array of size n then maximum index we can acces is n-1 right?.
Now in your case u want to access index n,m which will possible only when u declare array with size 1 bigger then the index u accessing .(i.e arr[m+1][n+1]:wink:

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.