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.
using builtin substring find methods is not the problem. it's the implemention that really matters.
you can still use an optimized find method (c++/python) or indexOf (java/js) to check if the substring exists. just make sure to keep looking for additional substrings if a substring's already found in that given line.
I'd imagine this would extend to real life matrix problems, since real data tend to be clustered.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Grid Search
You are viewing a single comment's thread. Return to all comments →
using builtin substring find methods is not the problem. it's the implemention that really matters.
you can still use an optimized find method (c++/python) or indexOf (java/js) to check if the substring exists. just make sure to keep looking for additional substrings if a substring's already found in that given line.
I'd imagine this would extend to real life matrix problems, since real data tend to be clustered.