Skip to content

Commit 681f97a

Browse files
committed
Removal of unnecessary code for JS problem 74
1 parent 3c5c94a commit 681f97a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

javascript/74-Search-A-2D-Matrix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function searchMatrix(matrix, target) {
1313
const width = matrix[0].length;
1414
const height = matrix.length;
1515
let i = 0;
16-
let j = (height - 1) * width + width - 1;
16+
let j = height * width - 1;
1717

1818
while (i <= j) {
1919
const m = Math.floor((i + j) / 2);
@@ -91,4 +91,4 @@ function searchMatrix(matrix, target) {
9191
*/
9292
function top(arr) {
9393
return arr[arr.length - 1];
94-
}
94+
}

0 commit comments

Comments
 (0)