Reported September 2026
Waymotwo pointers

Dictionary Matches from Repeated Letters

Reported by candidates from Waymo's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Waymo OA. Under 2s to a working solution.
Founder's read

Waymo reported this one in September 2026, and the title sounds friendlier than it is. You get a typed string with stuck keys and a dictionary of words, and you have to return which words could have produced it. The data structure the solution hinges on is a run-length encoding of typed, built once and then compared against every dictionary word. If your OA lands in the next day or two, this is a two-pointer string problem dressed up as a dictionary lookup. StealthCoder sits invisibly on your screen as a safety net if you blank on the run comparison mid-assessment.

The problem

The string typed was formed by taking a word and repeating each character one or more consecutive times. For every word in dictionary, determine whether deleting only extra copies inside runs of typed can produce that word.
Return matching dictionary entries in their original order. Duplicates in the dictionary remain duplicated.

Function
expandedWordMatches(typed: String, dictionary: String[]) → String[]

Examples
Example 1
typed = "heellp"
dictionary = ["help","heelp","hello"]
return = ["help","heelp"]
Each matching run uses no more copies than typed provides.
Example 2
typed = "aaabb"
dictionary = ["ab","aab","aaabb","abbc"]
return = ["ab","aab","aaabb"]
The a and b run counts may independently shrink but not vanish.
Example 3
typed = "abc"
dictionary = ["abc","abbc","ac"]
return = ["abc"]
No run has an extra copy to remove.

Constraints
1 <= typed.length <= 10^5.
The total dictionary character count is at most 2 * 10^5.
All strings contain lowercase English letters.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick: compress typed into (char, count) runs once. For each dictionary word, walk it with a pointer and compare its runs to typed's runs in order. Characters must match, the number of runs must match, and the word's run length must be at least 1 and at most typed's run length. Look at example 1: heellp has runs h1 e2 l2 p1, and help has h1 e1 l1 p1, so it matches. Hello fails because its l run is 2 but then an o follows, so the run structure differs. The common pitfall is the opposite rule from the classic stretchy words problem. Here any smaller count is fine, as long as it's at least 1. Don't rebuild typed's runs per word, since 10^5 times many words blows up. Keep the output in original order and keep duplicates. Total work is O(|typed| + total dictionary length). If you freeze on the pointer logic, StealthCoder is the hedge during the live OA.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

You can drill Dictionary Matches from Repeated Letters cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Waymo's OA.

Waymo reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Dictionary Matches from Repeated Letters FAQ

What's the trick in the Waymo dictionary matches problem?+

Run-length encode typed once. Then for each dictionary word, compare its runs to typed's runs in order. Same character, same number of runs, and the word's count must be between 1 and typed's count. Anything outside that fails.

How hard is this one really?+

Medium at most. There's no fancy algorithm. It's careful string handling with two pointers and a precomputed run list. Most failures come from off-by-one errors at the end of a run or from forgetting to check that both strings are fully consumed.

Does this match the stretchy words rule?+

It's similar but not the same. Here any word run from 1 up to typed's run length is valid, with no minimum of 3 and no special case. A word run longer than typed's run always fails. Read the examples before copying old code.

What's the time complexity I should aim for?+

Linear in total input. Build typed's runs in O(n), then scan each word once in O(length of word). With typed up to 10^5 and dictionary characters up to 2 * 10^5, anything that rescans typed per word is too slow.

How do I prepare in 48 hours?+

Write the run-length encoder from memory until it's automatic. Then write the two-pointer comparison and test on the three examples, plus edge cases like single-character strings and a word longer than typed. Check that duplicates in the dictionary stay duplicated in the output.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Waymo.

OA at Waymo?
Invisible during screen share
Get it