Minimum Array End Leetcode Solution 8624 Paint