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.
The naive solution never seems to be good enough here. Identifying each substring and testing if its valid ends up having a loop within a loop, and timing out.
Nope, HackerRank wants a single traversal over the string and some clever hacks.
Special String Again
You are viewing a single comment's thread. Return to all comments →
The naive solution never seems to be good enough here. Identifying each substring and testing if its valid ends up having a loop within a loop, and timing out.
Nope, HackerRank wants a single traversal over the string and some clever hacks.