We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Nice guard clause.. Also for extemely large strings, you can return "YES" as soon as j==str.length(), that way you don't have to iterate through the entire string.
HackerRank in a String!
You are viewing a single comment's thread. Return to all comments →
Nice guard clause.. Also for extemely large strings, you can return "YES" as soon as j==str.length(), that way you don't have to iterate through the entire string.