leetcode524】的更多相关文章

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 lexicographic…
public class Solution { public string FindLongestWord(string s, IList<string> d) { string longest = ""; foreach (var dictWord in d) { ; foreach (var c in s) { if (i < dictWord.Length && c == dictWord[i]) { i++; } } if (i == dict…