Gnerate all permutation || Easy to understand || C++
\nclass Solution {\npublic:\n    int ans;\n    int covered(vector<vector<int>>& mat,vector<int>&nums){\n        int count=0;\n        for(int i=0;i<mat.size();i
```\nclass Solution {\npublic:\n    int ans;\n    int covered(vector<vector<int>>& mat,vector<int>&nums){\n        int count=0;\n        for(int i=0;i<mat.size();i++){\n            int f=1;\n            for(int j=0;j<mat[0].size();j++){\n                if(mat[i][j]==1 && nums[j]==0) f=0;\n            }\n            if(f==1) count++;\n        }\n        return count;\n    }\n    void solve(vector<int>&nums,int cols,vector<vector<int>>&mat,int i){\n          if(i>=nums.size() && cols>0) return;\n          if(cols==0){\n              ans=max(ans,covered(mat,nums));\n              return;\n          }\n        nums[i]=1;\n        solve(nums,cols-1,mat,i+1);\n        nums[i]=0;\n        solve(nums,cols,mat,i+1);\n    }\n    int maximumRows(vector<vector<int>>& mat, int cols) {\n        ans=0;\n        vector<int>nums(mat[0].size(),0);\n        solve(nums,cols,mat,0);\n        return ans;\n    }\n};\n```
['C', 'Probability and Statistics']