Page Allocation Problem Leetcode Contest Answers