File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,12 @@ public static class Solution1 {
12
12
/**
13
13
* credit: https://discuss.leetcode.com/topic/36383/share-my-solution
14
14
*/
15
- public List <String > findItinerary (String [][] tickets ) {
15
+ public List <String > findItinerary (List < List < String >> tickets ) {
16
16
Map <String , PriorityQueue <String >> flights = new HashMap <>();
17
17
LinkedList <String > path = new LinkedList <>();
18
- for (String [] ticket : tickets ) {
19
- flights .putIfAbsent (ticket [ 0 ] , new PriorityQueue <>());
20
- flights .get (ticket [ 0 ]) .add (ticket [ 1 ] );
18
+ for (List < String > ticket : tickets ) {
19
+ flights .putIfAbsent (ticket . get ( 0 ) , new PriorityQueue <>());
20
+ flights .get (ticket . get ( 0 )) .add (ticket . get ( 1 ) );
21
21
}
22
22
dfs ("JFK" , flights , path );
23
23
return path ;
You can’t perform that action at this time.
0 commit comments