Page Allocation Problem Leetcode Two Sums