Patching Array Leetcode Solution 862 Heads