Sam and substrings Discussions | Algorithms | HackerRank
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.
You can download and inspect the test cases to debug your code, watching its behaviour on inputs resulting in fails. If the first case works you might have a problem counting all occurrences of the search word in areas where it appears twice or at the beginning or end of the line (e.g. foo food (foo) bar foob foo foo should yield 4), but debugging with known test inputs is generally a good direction here.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sam and substrings
You are viewing a single comment's thread. Return to all comments →
You can download and inspect the test cases to debug your code, watching its behaviour on inputs resulting in fails. If the first case works you might have a problem counting all occurrences of the search word in areas where it appears twice or at the beginning or end of the line (e.g.
foo food (foo) bar foob foo fooshould yield4), but debugging with known test inputs is generally a good direction here.