public static void Main(string[] args) { var testTable = new TestTable(); testTable.AddRow(new TestTableRow(1, 1, 1)); testTable.AddRow(new TestTableRow(2, 1, 2)); testTable.AddRow(new TestTableRow(3, 2, 5)); testTable.AddRow(new TestTableRow(4, 2, 1)); testTable.AddRow(new TestTableRow(5, 3, 2)); var firstAnswer = testTable.FindExactStart(new[] { 1, 2 }); Console.WriteLine("First answer: " + firstAnswer); var secondAnswer = testTable.FindExactStart(new[] { 1, 2, 5 }); Console.WriteLine("Second answer: " + secondAnswer); }