Doubt doubt doubt

kya mene sahi code likha h ??
Vscode me work nahi kar raha par CB ide me sahi answer aa raha h.

hello @parth_tyagi

here u need to handel the case Ti==0 or Tj==0 seprately,
becuase in such cases u cant access Ti-1 or Tj-1 as they will be -1.

refer this->

ok…but it worked fine in CB ide. https://ide.codingblocks.com/s/464570 is it correct ???

yeah becuase cb ide allows negative indexing . but it is not good practice , always handle such cases explicitly.

check now->

done!!!

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.