Minimum Array End Leetcode Problems Sql