Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If there are more than one possible results, return the longest word with the smallest lexicographical order. If there is no possible result, return the empty string.
Example1:Input:s = “abpcplea”, d = [“ale”,”apple”,”monkey”,”plea”] Output: “apple”
Example2:Input:s = “abpcplea”, d = [“a”,”b”,”c”] Output: “a”
题目内容给定一个字符串s和一个字符串列表d,通过删除字符串s中的一些字符可以在字符串列表d中找到与其相同的字符串。找出d中属于s的最长子序列。Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some charact...