Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit826bdee

Browse files
authored
Update _332.java (fishercoder1534#95)
Previous solution gave **Compile Error** on Leetcode
1 parent55315c6 commit826bdee

File tree

1 file changed

+4
-4
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+4
-4
lines changed

‎src/main/java/com/fishercoder/solutions/_332.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ public static class Solution1 {
1212
/**
1313
* credit: https://discuss.leetcode.com/topic/36383/share-my-solution
1414
*/
15-
publicList<String>findItinerary(String[][]tickets) {
15+
publicList<String>findItinerary(List<List<String>>tickets) {
1616
Map<String,PriorityQueue<String>>flights =newHashMap<>();
1717
LinkedList<String>path =newLinkedList<>();
18-
for (String[]ticket :tickets) {
19-
flights.putIfAbsent(ticket[0],newPriorityQueue<>());
20-
flights.get(ticket[0]).add(ticket[1]);
18+
for (List<String>ticket :tickets) {
19+
flights.putIfAbsent(ticket.get(0),newPriorityQueue<>());
20+
flights.get(ticket.get(0)).add(ticket.get(1));
2121
}
2222
dfs("JFK",flights,path);
2323
returnpath;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp