please explain at each step strength should be greater than k or 0 because in question it is written strength should be positive but in video it is said at every step strength should be greater than k . one more thing which value we have to print , if ans comes out yes. because in the given example maximum value of strength after a row will be 15 after 1st traversing 1st row
Algo++ : piyush and magical park
hi Aman
- check if the Strength is lower than the threshold viz, K, print βNoβ and return.
- if the ans calculated at the end is greater then k(threshold value) then print βyesβ and the ans calculated else print βnoβ
you have to only print the answer at the end(after traversing the whole 2d matrix)
which ans we have to print because in the given example at the end of matrix strength left is 9 but 13 is printed in the example