Find the minimum length word from a given dictionary words, which has all the letters from the string licensePlate. Such a word is said to complete the given string licensePlate Here, for letters we ignore case. For example, "P" on the licensePl…
public class Solution { public string ShortestCompletingWord(string licensePlate, string[] words) { var list = words.OrderBy(x => x.Length); var pattern = licensePlate.ToLower(); var dic = new Dictionary<char, int>(); foreach (var p in pattern) {…