Rotate Image
问题:矩阵顺时针旋转90度
class Solution { public: bool dfs(vector<vector<int> > &matrix,int target,int n) { if(n==matrix.size()) return false; if(matrix[n][0]>target) return false; for(int i=0;i<matrix[n].size();i++) { if(matrix[n][i]==target) return true; if(matrix[n][i]>target) return false; } return dfs(matrix,target,n+1); } bool searchMatrix(vector<vector<int> > &matrix, int target) { return dfs(matrix,target,0); } };