← Microsoft questions
CodingReported in a candidate post, Apr 2021

Count elements in query ranges where max minus min is below k

Filed under Microsoft

You are given an array nums of n integers, an integer k and q queries, each a pair (L, R) of 0-based inclusive indices. For each query, count the sub-ranges inside [L, R] for which the absolute…

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

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