https://ide.geeksforgeeks.org/UxpYHVhjKy
this in my link code…I have just use a print() function which is just extra for debugging and rest is the code…can u please help me with the test case for which I am getting wrong…
https://ide.geeksforgeeks.org/UxpYHVhjKy
this in my link code…I have just use a print() function which is just extra for debugging and rest is the code…can u please help me with the test case for which I am getting wrong…
@kaushikjatin
3 3
3 1 2
3 2 0
2 3 2
Print your matrices for this test case
The second matrix is incorrect
Element at 1,1 should be 4 not 5
@Aarnav-Jindal-1059677350830863 bro…here we need to maximize the workout…so we need to take the max weight path not the min bro…so 2+1+2=5 will give more calories burned rather than 2+0+2=4
@kaushikjatin yeah I made a mistake there sorry buddy
The issue is with your loop to compute the answer after precompute
You’re adding values for all cases instead of considering them separately where both people can enter of exit from the same path
Try to dry run your code once
You’ll see since you’re not making those cases people are travelling the same place twice
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.
Bro…how can they enter or exit from same path…the condition is that bro,their path must only intersect at one point…so how can they enter or exit at a box from same point…If I am not able to correctly get u bro…then please tell me a test caseso that I might come to know while dry run…
@ Aarnav JIndal got it bro…I was actually taking the edges of the matrix into account which can never be a meeting point…