Leetcode Activity Selection Problem Hackerrank