File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
solution/1600-1699/1631.Path With Minimum Effort Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -818,7 +818,7 @@ func (h *hp) Pop() any { a := *h; v := a[len(a)-1]; *h = a[:len(a)-1];
818818function minimumEffortPath(heights : number [][]): number {
819819 const m = heights .length ;
820820 const n = heights [0 ].length ;
821- const pq = new PriorityQueue ({ compare : (a , b ) => a [0 ] - b [0 ] } );
821+ const pq = new PriorityQueue < number []>( (a , b ) => a [0 ] - b [0 ]);
822822 pq .enqueue ([0 , 0 , 0 ]);
823823 const dist = Array .from ({ length: m }, () => Array .from ({ length: n }, () => Infinity ));
824824 dist [0 ][0 ] = 0 ;
Original file line number Diff line number Diff line change @@ -816,7 +816,7 @@ func (h *hp) Pop() any { a := *h; v := a[len(a)-1]; *h = a[:len(a)-1];
816816function minimumEffortPath(heights : number [][]): number {
817817 const m = heights .length ;
818818 const n = heights [0 ].length ;
819- const pq = new PriorityQueue ({ compare : (a , b ) => a [0 ] - b [0 ] } );
819+ const pq = new PriorityQueue < number []>( (a , b ) => a [0 ] - b [0 ]);
820820 pq .enqueue ([0 , 0 , 0 ]);
821821 const dist = Array .from ({ length: m }, () => Array .from ({ length: n }, () => Infinity ));
822822 dist [0 ][0 ] = 0 ;
Original file line number Diff line number Diff line change 11function minimumEffortPath ( heights : number [ ] [ ] ) : number {
22 const m = heights . length ;
33 const n = heights [ 0 ] . length ;
4- const pq = new PriorityQueue ( { compare : ( a , b ) => a [ 0 ] - b [ 0 ] } ) ;
4+ const pq = new PriorityQueue < number [ ] > ( ( a , b ) => a [ 0 ] - b [ 0 ] ) ;
55 pq . enqueue ( [ 0 , 0 , 0 ] ) ;
66 const dist = Array . from ( { length : m } , ( ) => Array . from ( { length : n } , ( ) => Infinity ) ) ;
77 dist [ 0 ] [ 0 ] = 0 ;
You can’t perform that action at this time.
0 commit comments