aboutsummaryrefslogtreecommitdiff
path: root/search_2d_matrix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'search_2d_matrix.cpp')
-rw-r--r--search_2d_matrix.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/search_2d_matrix.cpp b/search_2d_matrix.cpp
index 44c42d4..3d8ce04 100644
--- a/search_2d_matrix.cpp
+++ b/search_2d_matrix.cpp
@@ -12,7 +12,7 @@
class Solution {
public:
- bool searchMatrix(vvd(int) & matrix, int target) {
+ bool searchMatrix(vvd & matrix, int target) {
int rows = matrix.size(), cols = matrix[0].size(), row = 0, col = cols - 1;
while (row < rows && col > -1) {
int curr = matrix[row][col];
@@ -29,7 +29,7 @@ public:
int main() {
Solution obj;
- vvd(int) matrix = {{1, 3, 5, 7}, {10, 11, 16, 20}, {23, 30, 34, 60}};
+ vvd matrix = {{1, 3, 5, 7}, {10, 11, 16, 20}, {23, 30, 34, 60}};
printf("%d\n", obj.searchMatrix(matrix, 3)); // expect: 1
printf("%d\n", obj.searchMatrix(matrix, 13)); // expect: 0
}