Your question is Find Articles Containing a Word. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
NextRoll's content search needs to identify which articles contain a requested word. Given a list of article bodies and one search query, return the indices of every article containing that word as a complete, case-insensitive token.
A word consists of one or more ASCII letters or digits. Punctuation separates words, so ads matches Ads, but does not match adserver. Return article indices in their original order, with no duplicates.
Implement find_articles(articles, query).
articles is a list of strings, where each string is one article's body.query is a non-empty string containing only ASCII letters and digits.def find_articles(articles, query):