Shortest path to transform one word into another

后端 未结 9 2370
梦如初夏
梦如初夏 2020-12-01 00:44

For a Data Structures project, I must find the shortest path between two words (like \"cat\" and \"dog\"), changing only one letter at a time. We a

9条回答
  •  半阙折子戏
    2020-12-01 00:51

    You could find the longest common subsequence, and therefore finding the letters that must be changed.

提交回复
热议问题