public string[] ListPath(string startWord, string endWord, string[] dictionary) { var inputWordLength = startWord.Length; _graphBuilder.BuildWordGraph(inputWordLength, dictionary); var startWordGraphNode = _graphBuilder.GetNodeByWord(startWord); var endWordGraphNode = _graphBuilder.GetNodeByWord(endWord); var path = _shortestPathFinder.FindShortestPath(startWordGraphNode, endWordGraphNode); return(path.ToArray()); }