Page Allocation Problem Leetcode Two Pointer