Code Room
CodingMedium
Question
Given a static integer array arr and a list of inclusive range queries [l, r] (0-indexed, l <= r), return the minimum element of each range. Build a segment tree so each query is O(log n). Values may be negative. Return the list of minima in query order.
Implement
range_min_queries(arr: list[int], queries: list[list[int]]) → list[int]Examples
in
[[2,5,1,4,9,3],[[0,5],[1,3],[4,4],[3,5]]]out[1,1,9,3]What a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Learn the concepts
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.
Run or narrate your approach, then ask the coach.