Back to problems

Find Anagram in String

Algorithm · Atlassian · Medium

You are given two inputs: words: a list of distinct, lowercase English strings. s: a lowercase English string. Walk through words in the order they appear. Return the first word for which any anagram of that word exists as a substring inside s. If none of the words satisfy this, return an empty string "". Definitions A substring is a contiguous block of characters within s. Two strings are anagrams of each other if you can rearrange the letters of one to obtain the other.…

Checking your access…