Minimum Array End Leetcode Problem 9