Minimum Array End Leetcode Solutions Java