← Amazon questions

Check if string contains an anagram of another string as a substring

Filed under Amazon

Given two strings s1 and s2, return true if s1 contains a permutation (anagram) of s2 as a substring, or false otherwise.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.