print the maximum strength that he can gather in the park in a new line. I am not getting why value is 13 over here
String piyush and magical park problem
4 4 5 20
. . * .
. # . .
* * . .
. # * *
S=20 and k=5;
first row:
20-2-1-2-1+5-1-2=16
second row:
16-2=14 (Now, he cannot move any further)
third row: -1 for changing the row
14-1+5-1+5-1-2-1-2=16
fourth Row:
16-2-1=13
As 13 >=5, Print “Yes” and 13
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.