What is wrong with this code,

what is wrong in my code. plz tell and explain.

@Kunalgoyal don’t return -1 inside for loop when s<k instead break the loop and print “No”.

one doubt. if i print No in the loop and if s<k then wont it print No 5 times

so break both the for loops after printing “No”

how to break from both the loops. can u write the condition

take a bool flag, initialize it with “false”, after printing “No” make this flag=true, and check if(flag==true) inside both for loops if yes then break them.

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.