✅C++ || EASY Beginner Friendly
Code\n\nclass Solution {\npublic:\n    bool searchMatrix(vector<vector<int>>& matrix, int target) {\n       int n=matrix.size();\n       int m=matrix[0].size();
# Code\n```\nclass Solution {\npublic:\n    bool searchMatrix(vector<vector<int>>& matrix, int target) {\n       int n=matrix.size();\n       int m=matrix[0].size();\n       int i=0,j=m-1;\n       while(i<n && j>=0){\n           if(matrix[i][j]==target) return true;\n           else if(matrix[i][j]<target)i++;\n           else j--;\n       }\n       return false;\n    }\n};\n```\n![upvote (3).jpg](https://assets.leetcode.com/users/images/3a830886-b93d-44bb-921f-c385552a3db0_1676886905.778097.jpeg)\n
['C++']