← Barclays questions

Minimum subarray with sum >= k

Filed under Barclays

Given an array of positive integers and a target integer k, find the length of the minimum contiguous subarray whose sum is greater than or equal to k. Return 0 if no such subarray exists.

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 Barclays questions

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