Python3 Solution | Very Easy Approach
The solution is very simple:\nFirst we will find all the combinations, and then we will iterate over all the combinations of the array. At each iteration, check
*The solution is very simple:*\n**First we will find all the combinations, and then we will iterate over all the combinations of the array. At each iteration, check every row and cols.**\n\n\tclass Solution:\n\t\tdef maximumRows(self, mat: List[List[int]], cols: int) -> int:\n\t\t\tallCombinations = []\n\n\t\t\tdef combina(nums, k, path):\n\t\t\t\tif len(path) == k:\n\t\t\t\t\tallCombinations.append((path))\n\t\t\t\t\treturn\n\t\t\t\tfor i in range(len(nums)):\n\t\t\t\t\tcombina(nums[i+1:], k, path+[nums[i]])\n\n\t\t\tcol = len(mat[0])\n\t\t\tans = 0\n\t\t\tcombina(list(range(0, col)), cols, [])\n\t\t\tfor comb in allCombinations:\n\t\t\t\ttot = 0\n\t\t\t\tcomb = set(comb)\n\t\t\t\tfor row in mat:\n\t\t\t\t\tflag = True\n\t\t\t\t\tfor i in range(col):\n\t\t\t\t\t\tif row[i] and i not in comb:\n\t\t\t\t\t\t\tflag = False\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\tif flag:\n\t\t\t\t\t\ttot += 1\n\t\t\t\tans = max(ans, tot)\n\t\t\treturn ans
['Python', 'Python3']