Patching Array Leetcode Solution 1984