Leetcode Activity Selection Problem Algorithm Example