Simple and Easy JAVA Solution , using Memoization , invert the question and solve
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    public int maxScore(List<List<Integer>> grid) {\n        //Instead of picking the max number from each row\n        //Pick the row for each number \n        int m = grid.size();\n        int n = grid.get(0).size();\n        List<Integer> arr[] = new ArrayList[101];   \n\n        for(int i=0;i<101;i++)\n            arr[i] = new ArrayList<>();\n        \n        int min = Integer.MAX_VALUE;\n        int max = Integer.MIN_VALUE;\n        for(int i=0;i<m;i++){\n            for(int j=0;j<n;j++){\n                max = Math.max(max,grid.get(i).get(j));\n                min = Math.min(min,grid.get(i).get(j));\n                arr[grid.get(i).get(j)].add(i);\n            }\n        }\n\n        Integer dp[][] = new Integer[101][(int)Math.pow(2,10) + 1];\n        return helper(arr,max,min,0,dp);\n    }\n\n    private static int helper(List<Integer> arr[],int num,int min,int mask,Integer dp[][]){\n        if(num < min)\n            return 0;\n        \n        if(dp[num][mask] != null)\n            return dp[num][mask];\n        \n        dp[num][mask] = 0;\n        for(int r : arr[num]){\n            if((mask&(1 << r))==0)\n                dp[num][mask] = Math.max(dp[num][mask] , num + helper(arr,num-1,min,(mask|(1 << r)),dp));\n        }\n\n        dp[num][mask] = Math.max(dp[num][mask] , helper(arr,num-1,min,mask,dp));\n\n        return dp[num][mask];\n    }\n}\n```
['Java']