Where am i going wrong in piyush and park problem?

@itismohiton inside your nested for loop if(s<k) after you have printed “No” you are breaking only inner for loop but your code will run for outer for loop and will again print “No”.
you should break both for loop after printing “No”.

Resolved. Thank you very much.

1 Like