Skip to content

Commit 3c3f497

Browse files
authored
fix: update ts solution to lc problem: No.1631 (#4928)
1 parent 2d6d2c9 commit 3c3f497

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

solution/1600-1699/1631.Path With Minimum Effort/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ func (h *hp) Pop() any { a := *h; v := a[len(a)-1]; *h = a[:len(a)-1];
818818
function 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;

solution/1600-1699/1631.Path With Minimum Effort/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ func (h *hp) Pop() any { a := *h; v := a[len(a)-1]; *h = a[:len(a)-1];
816816
function 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;

solution/1600-1699/1631.Path With Minimum Effort/Solution3.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function 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;

0 commit comments

Comments
 (0)