Greedy intervals: Return the minimum number of points needed so that every closed interval contains at least one chosen point.
Input: A JSON object { "intervals": [number, number][] }.
Output: A JSON integer minimum point count.
Constraints:
- 0 <= intervals.length <= 100000
- Every interval satisfies start <= end
- Intervals are closed, so a shared endpoint can cover both
Read one JSON value from stdin and print exactly one JSON-serialized answer to stdout with no extra text.
Difficulty: EASY. Variant: 10. Balance correctness, maintainability, and clear review-ready code.
Practice context
This coding (algo) exercise trains prompt interpretation, explicit assumptions, a concrete response, and a concise explanation of the decisions made. It is marked easy difficulty.
The signed-in workspace provides the tools required by the round, such as recording, code execution, diagrams, s