Back to problems

Find the First Dictionary Word Matchable as a Reusable-Character Subsequence

Algorithm · Capital One · Medium

You are given a string s and an ordered list dictionary of candidate words. All characters are lowercase English letters. A word w from the dictionary matches s if it is possible to walk through s from left to right and pick out the characters of w in order, subject to one special rule: after matching a character at some index in s, you are allowed to stay at that exact same index for the very next character of w. In other words, the same position in s may be reused, so…

Checking your access…