Goldman Sachs logoGoldman Sachs
Coding·60 minMembers

Longest Subarray With Sum ≤ K

Members only

Classic two-pointer / sliding-window: given an array of non-negative integers and a bound K, return the length of the longest contiguous subarray whose sum does not exceed K.

SWE
sliding-window
array
two-pointer
easy
Frequency
Single report
Last asked
2024-10-26
Stage
oa

Log in to continue reading the full content

Comments

Sign in to join the discussion
Loading...