Problem explanation with given testcase

Can some one explain me the how result is Yes and 13. I am having hard time getting the question.

Hi Mohit,
See for input:
4 4 5 20
. . * .
. # . .

    • . .
      . # * *

after first row the resulting strength would be 16 which is greater than 5 then, in second row you can only traverse till 2nd column as in second column there is # so resulting strength is 13 which is still greater than 5, then after traversing third row strength is 16 which is still greater than 5, then in fourth row you can only traverse till 2nd column as in second column there is # so resulting strength is 13 which is greater than 5.

Therefore the answer is yes and resulting strength is 13.

Dear, Why are the checking for condition after completion of rows and not after each step as mentioned in the question. Correct me, if I am wrong.

Hi Mohit,
In actual you have to check the condition after completion of each step but since the given strength is so high so in explanation I had just skip this part.

Ok, I got the point.
Thanks.

Submitted successfully, thanks.