Minimum Array End Leetcode Solution