Test cases getting failed

Hello @S19LPPP0192,

Read the following part of the code very carefully.

Output Format:
Print “Yes” or “No” depending on whether Piyush can escape or not. If the answer is “Yes”, also print the maximum strength that he can gather in the park in a new line.

You are also printing the strength for the cases with result as “No”, which is not required by the problem.

Solution:

    if(s>=k){
 cout<<"Yes"<<endl;
    cout<<s;
    }
    else
    cout<<"No";

Hope, this would help.
Give a like, if you are satisfied.

1 Like

Got that. Thanks for helping.!

Please, mark it as resolved.
BTW, i won’t mind a like.:rofl: