โ† Amazon questions

Min length subarray sum >= k

Filed under Amazon

Given an array of positive integers and an integer k, find the minimum length of a contiguous subarray of which the sum is at least k. If there is no such subarray, return -1.

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.