← BNY Mellon questions
CodingEasy

Length of longest subarray with sum less than or equal to k

Filed under BNY Mellon

Given an array of positive integers `nums` and an integer `k`, find the length of the longest contiguous subarray whose elements sum up to a value less than or equal to `k`. Return 0 if no such…

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 BNY Mellon questions

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