Kimi LeetCode LCP 21. 追逐游戏 Java实现
以下是 LeetCode LCP 21. 追逐游戏的 Java 实现,基于 BFS 拓扑排序找环的经典解法:java
class Solution {private List<List<Integer>> g;public int chaseGame(int[][] edges, int startA, int startB) {int n edges.length;g new Array…
2026/8/21 21:33:31