Java - Using prefix xor Matrix & Priority Queue
\npublic int kthLargestValue(int[][] matrix, int k) {\n        int N = matrix.length;\n        int M = matrix[0].length;\n        PriorityQueue<Integer> pq = ne
```\npublic int kthLargestValue(int[][] matrix, int k) {\n        int N = matrix.length;\n        int M = matrix[0].length;\n        PriorityQueue<Integer> pq = new PriorityQueue<>();\n        int[][] preXor = new int[N][M];\n        for(int i = 0 ; i < N ; i++) {\n            for(int j = 0 ; j < M ; j++) {\n                if(i == 0) {\n                    preXor[i][j] = (j == 0) ? matrix[i][j] : matrix[i][j] ^ preXor[i][j - 1];\n                } else if(j == 0) {\n                    preXor[i][j] = matrix[i][j] ^ preXor[i - 1][j];\n                } else {\n                    preXor[i][j] = matrix[i][j] ^ preXor[i - 1][j] ^ preXor[i][j - 1] ^ preXor[i - 1][j - 1];\n                }\n                pq.add(preXor[i][j]);\n                if(pq.size() > k) {\n                    pq.remove();\n                }\n            }\n        }\n        \n        return pq.peek();\n    }\n```
[]