← Morgan Stanley questions
CodingMediumReported in a candidate post, Oct 2020

Smallest subarray with sum greater than or equal to x

Filed under Morgan Stanley

Given an array of integers and a target x, find the minimal length of a contiguous subarray such that the sum of its elements is >= x.

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 Morgan Stanley questions

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