Algorithm · Google · Hard
A string s and a list words are provided. Each entry in words is a dictionary word made of lowercase English letters. A contiguous segment of s is considered valid if its letters can be rearranged into at least one entry from words; equivalently, the segment and the dictionary entry must be anagrams. Your task is to return true if every contiguous segment of s whose length is at least 3 is valid. Otherwise, return false. If s is shorter than 3, there are no segments to…
Checking your access…