java solution
class Solution {\n    public int kthLargestValue(int[][] mat, int k) {\n        int n = mat.length;\n        int m = mat[0].length;\n        List al = new Array
class Solution {\n    public int kthLargestValue(int[][] mat, int k) {\n        int n = mat.length;\n        int m = mat[0].length;\n        List<Integer> al = new ArrayList<>();\n        \n        int[][] dp = new int[n][m];\n        \n        for(int i=0;i<n;i++)\n        {\n            for(int j=0;j<m;j++)\n            {\n                if(i == 0 && j == 0)\n                {\n                    dp[i][j] = mat[i][j];\n                }\n                \n                else if(i == 0)\n                {\n                    dp[i][j] = dp[i][j-1] ^ mat[i][j];\n                }\n                \n                else if(j == 0)\n                {\n                    dp[i][j] = dp[i-1][j] ^ mat[i][j];\n                }\n                \n                else\n                {\n                    dp[i][j] = dp[i-1][j] ^ dp[i][j-1] ^ dp[i-1][j-1] ^ mat[i][j];\n                }\n                \n                al.add(dp[i][j]);\n            }\n        }\n        \n        Collections.sort(al);\n        return al.get(n*m-k);\n    }\n}
['Dynamic Programming', 'Java']