using System.Collections.Generic;
public static void Main()
List<List<string>> variants = new List<List<string>>();
variants.Add(new List<string> {"cars", "boats", "planes"});
variants.Add(new List<string> {"money", "trees", "plants"});
variants.Add(new List<string> {"green", "blue", "red" });
variants.Add(new List<string> {"kid", "adult", "senior"});
variants.Add(new List<string> {"tax", "insurance", "salary"});
List<List<string>> options = new List<List<string>>();
options.Add(new List<string> { "senior", "adult", "kid" });
options.Add(new List<string> { "blue", "red", "green"});
options.Add(new List<string> {"money", "trees", "plants"});
Console.WriteLine(AllIncluded(variants, options));
List<List<string>> options2 = new List<List<string>>();
options2.Add(new List<string> { "senior", "adult", "kid" });
options2.Add(new List<string> { "orange", "red", "green"});
options2.Add(new List<string> {"money", "trees", "plants"});
Console.WriteLine(AllIncluded(variants, options2));
List<List<string>> options3 = new List<List<string>>();
options3.Add(new List<string> { "senior", "red", "adult" });
options3.Add(new List<string> { "blue", "kid", "green"});
options3.Add(new List<string> {"money", "trees", "plants"});
Console.WriteLine(AllIncluded(variants, options3));
private static bool AllIncluded(List<List<string>> variants, List<List<string>> options)
List<HashSet<string>> variantSets = variants.Select(vl => new HashSet<string>(vl)).ToList();
return options.All(ol => variantSets.Any(vs => ol.All(vs.Contains)));