โ† Amazon questions

Maximum of Subarrays and Substrings with K Distinct Characters

Filed under Amazon

Given an array of integers, find the maximum value in all contiguous subarrays of size K. Additionally, given a string, count all substrings that contain at most K distinct characters.

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.