Solved LeetCode program · 925 of 1,000
#1288 · Remove Covered Intervals
Original English source
The starts is a list of 1, 3, and 2. The ends is a list of 4, 6, and 8. The last is the last position of starts. The answer is 0.
For every leftspot from 0 to last.
The covered is 0.
For every rightspot from 0 to last.
If leftspot is not rightspot and item rightspot of starts is at most item leftspot of starts and item leftspot of ends is at most item rightspot of ends, set covered to 1. If rightspot is last and covered is 0, add 1 to answer.
Show answer.
Expected stdout
2