Ranges not inside another
Each range is a pair [start, end] of integers with start <= end. A range lies inside another one when the other starts no later and ends no earlier: [2, 5] lies inside [1, 5], [2, 8] and [1, 9], but not inside [3, 9]. Remove every range that lies inside a different range of the list, and return how many ranges are left. Copies of the same range count as one range.
The list is not sorted, may be empty and values can be negative. Comparing every pair is O(n²): aim for O(n log n).
Besides the tests, one large input (3,500 ranges) with a ~200 ms limit (scaled to your device's speed): brute force won't pass.
Examples
count_outer_ranges([[1,4],[3,6],[2,8]])→2count_outer_ranges([[1,2],[1,4],[3,4]])→1count_outer_ranges([[1,2],[3,4],[5,6]])→3