Minimum Array End Leetcode Solution 1943