mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 00:43:04 +08:00
Merge pull request #2539 from yawebNW/master
Update 0332.重新安排行程.md 更新java版本
This commit is contained in:
@ -379,6 +379,8 @@ class Solution {
|
||||
String targetLocation;
|
||||
//遍历从当前位置出发的机票
|
||||
for (int i = 0; i < targetLocations.size(); i++) {
|
||||
//去重,否则在最后一个测试用例中遇到循环时会无限递归
|
||||
if(i > 0 && targetLocations.get(i).equals(targetLocations.get(i - 1))) continue;
|
||||
targetLocation = targetLocations.get(i);
|
||||
//删除终点列表中当前的终点
|
||||
targetLocations.remove(i);
|
||||
|
Reference in New Issue
Block a user