Minimum Array End Leetcode 150 Problem