Longest String With All Prefix Leetcode