An easy understanding solution
 // any comments are welcome\n     bool searchMatrix(vector<vector<int>>& matrix, int target) {\n        int m = matrix.size(), n = matrix[0].size();\n        i
     // any comments are welcome\n     bool searchMatrix(vector<vector<int>>& matrix, int target) {\n        int m = matrix.size(), n = matrix[0].size();\n        int i = 0, j = n - 1;\n        \n        // search target from up-right side to down-left side\n        while (i <= m-1 && j >= 0) {\n            if (matrix[i][j] == target)\n                return true;\n            else if (matrix[i][j] > target)\n                --j;\n            else // matrix[i][j] < target\n                ++i;\n        }\n        \n        return false;\n    }
[]