Interval Scheduling Problem Leetcode Javascript 30