public static void BFSOnAGridGraph() { var obj = new CareerCupQnA(); int[,] array2D = new int[, ] { { 0, 0, 0, 0, 0, 0, 0, 1 }, { 0, 0, 0, 0, 1, 0, 0, 1 }, { 0, 0, 0, 1, 0, 0, 0, 0 }, { 0, 1, 1, 1, 1, 0, 0, 0 }, { 0, 0, 0, 0, 1, 0, 0, 0 }, }; var res = obj.BFSOnAGridGraph(array2D, 5, 8); foreach (var str in res) { Console.WriteLine(str); } }