Code Room
CodingEasycod-g1469
Subject IntervalsLevel Entry–Mid~11 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Given a list of closed integer intervals, return True if some interval completely contains another one at a different index: interval [a, b] contains [c, d] when a <= c and d <= b. Two identical intervals count as containing each other. The list holds at most a few thousand intervals, so a quadratic scan is acceptable. Example: [[1,6],[2,4],[7,9]] is True because [1,6] contains [2,4].

Implement
has_contained_interval(intervals: list[list[int]]) → bool
Examples
in[[[1,6],[2,4],[7,9]]]outtrue
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.

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.