Slug: arr-window-02 · Paired reading: Chapter 15
Prompt
fn longest_under(nums: &[u32], budget: u32) -> usize — length of the
longest contiguous subarray whose sum is ≤ budget. Variable sliding
window; nums are non-negative.
The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).
Don’t have the book yet? The landing page stays open — purchase unlocks this gym.
intermediate · order 78
Slug: arr-window-02 · Paired reading: Chapter 15
fn longest_under(nums: &[u32], budget: u32) -> usize — length of the
longest contiguous subarray whose sum is ≤ budget. Variable sliding
window; nums are non-negative.