Using prefix xor easy implementation
\nclass Solution {\n    public int kthLargestValue(int[][] matrix, int k) \n    {\n        List<Integer> list=new ArrayList<>();\n        int m=matrix.length;\n
```\nclass Solution {\n    public int kthLargestValue(int[][] matrix, int k) \n    {\n        List<Integer> list=new ArrayList<>();\n        int m=matrix.length;\n        int n=matrix[0].length;\n        int[][] dp=new int[m][n];\n        \n        for(int i=0;i<m;i++)\n        {\n            for(int j=0;j<n;j++)\n            {\n                if(i==0 && j==0)\n                {\n                    dp[i][j]=matrix[i][j];\n                }\n                else if(i==0)\n                {\n                    dp[i][j]=matrix[i][j]^dp[i][j-1];\n                }\n                else if(j==0)\n                {\n                    dp[i][j]=dp[i-1][j]^matrix[i][j];\n                }\n                else\n                {\n                    dp[i][j]=dp[i-1][j]^dp[i][j-1]^dp[i-1][j-1]^matrix[i][j];\n                }\n                list.add(dp[i][j]);\n            }\n        }\n        Collections.sort(list);\n        return list.get(m*n-k);\n    }\n}\n```
['Prefix Sum', 'Java']