C++| 100% faster solution | with explanation | Binary search | easy
Approach:\n1. We will start iterate from m[0][m] or m[n][0]   where m = no. of colums and n =no. of rows.\n2. then we have have left element is always smaller a
**Approach:**\n1. We will start iterate from m[0][m] or m[n][0]   where m = no. of colums and n =no. of rows.\n2. then we have have left element is always smaller and down element is bigger then current in whole matrix (Given rows are sorted).\n3. Then we will loop from` (r < row && r >=0)` and ` (c < col && c >= 0)` this prevent overflow.\n4. Then if current element is smaller then will we go down ( `r++;` ).\n5. Then if current element is bigger then will we go left ( `c--;` ).\n6. If element found we will return true else false.\n\n\n\n```\nclass Solution {\npublic:\n    bool searchMatrix(vector<vector<int>>& matrix, int target) {\n        \n        int row = matrix.size();\n        int col = matrix[0].size();\n        \n        int c = col-1;\n        int r =0;\n        while((r < row && r >=0)  && (c < col && c >= 0)){\n            \n            int element = matrix[r][c];\n            \n            if(element == target){\n                return true;\n            }\n             else if(element > target){\n                  c--;\n            }else{\n                 r++;\n             }\n        }\n        return false;\n        \n    }\n};\n```\n\n**UPVOTE IF UNDERSTAND**
['C', 'Binary Tree']