You are viewing a single comment's thread. Return to all comments →
As soon as str.length() == j -> you can return "YES" so you don't have to iterate the rest of the loop.
Seems like cookies are disabled on this browser, please enable them to open this website
HackerRank in a String!
You are viewing a single comment's thread. Return to all comments →
As soon as str.length() == j -> you can return "YES" so you don't have to iterate the rest of the loop.