var sol = new Solution(); var cases = new (string s, string[] words, int[] expected)[] { // ("barfoothefoobarman", new[] { "foo", "bar" }, new[] { 0, 9 }), // ("wordgoodgoodgoodbestword", new[] { "word", "good", "best", "word" }, Array.Empty()), // ("barfoofoobarthefoobarman", new[] { "bar", "foo", "the" }, new[] { 6, 9, 12 }), ("wordgoodgoodgoodbestword", new[] { "word", "good", "best", "good" }, new[] { 8 }) }; string Format(IEnumerable values) => $"[{string.Join(",", values)}]"; string FormatWords(IEnumerable values) => $"[{string.Join(",", values)}]"; foreach (var (s, words, expected) in cases) { var actual = sol.FindSubstring(s, words); Console.WriteLine($"{s} | {FormatWords(words)} -> {Format(actual)} (expected: {Format(expected)})"); }