← Amazon questions
CodingReported in a candidate post, Sep 2022

Number of permutations of a pattern in a string

Filed under Amazon

Given a string s and a pattern string p, count how many substrings of s are permutations of p. Use a fixed-length sliding window approach with character frequency counts to solve the problem…

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.