I’m not understanding how the answer is 2 for the testcase, my ans comes out to be 3:
4 3 2
3 3
3 1
code: https://ide.codingblocks.com/s/90054
question :https://www.codechef.com/problems/CD1IT4
Robot path, codechef video lecture
No, the answer will be 2 only, because its a 4 x 3 block and you can only move down or towards the right. Moreover, there are many more errors in your code, you have not used mod operation, and do declare the dp to be of size one more than the maximum constraint. Currently, the size declared by you is 1000 which is the maximum constraint and thus your code will also result in a runtime error.
Do add mod and correct the size. You can check out the image to understand how the answer is 2.
1 Like
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.