Pinterest logoPinterest
Coding·60 minMembers

Subarray Score ≤ K (Sliding-Window)

Members only

Given an integer array and an integer K, count the number of contiguous subarrays whose `(sum × length)` score is at most K. Must be O(n).

SWE
array
sliding-window
two-pointer
prefix-sum
medium
Frequency
Single report
Last asked
2025-11-07
Stage
phone-screen

Log in to continue reading the full content

Comments

Sign in to join the discussion
Loading...