Algorithm · Waymo · Easy
You receive a string s made of lowercase letters. Think of s as a run-expanded form of some word, meaning any of its characters may have been typed several times in a row. To recover the underlying form, every maximal block of identical adjacent characters is reduced to a single copy of that character. A few illustrations: "heellp" → "help" "aaabcc" → "abc" "book" → "bok" Along with s, you get a word list dictionary. Output each word from dictionary that matches the…