Search In Sorted Matrix Time : O(n + m) Space : O(1) 12345678910vector<int> searchInSortedMatrix(vector<vector<int>> matrix, int target) { int n = matrix.size(), m = matrix[0].size(); int i = 0, j = m - 1; while(j >= 0 and i < n) { if(matrix[i][j] == target) return {i, j}; if(matrix[i][j] > target) j--; else i++; } return {-1, -1};}