Minimum Array End Leetcode Solution 8622