Search⌘ K
AI Features

Check If a Word is a Prefix of Any Word in a Sentence

Check If a Word is a Prefix of Any Word in a Sentence asks you to find the first word whose beginning matches searchWord, returning its one-based position or -1 if no word qualifies.

Statement

You are given a sentence containing words separated by single spaces and a searchWord. ...