Minimum Length Substrings Leetcode Sql Queries In Php