Interval Scheduling Problem Leetcode Javascript Questions