Page Allocation Problem Leetcode 150