Algo++ : Magical park

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 and after traversing whole matrix strength will be 9 . but in the given example 13 is printed .please explain how 13 is printed . please reply this time , i had asked same question earlier also but only some of my doubts are cleared after that no reply came

Piyush in the question, it is mentioned that strength should be greater than k, and at any time if it becomes less than k, then you need to break from loop, i.e, you cannot traverse the array further, and hence your ans will be No.
When ans comes yes, you need to print the current left strength only. , i.e value of s only .