Java O(NlogK) | PriorityQueue
Since PriorityQueue is with size of k, the complexity is O(NlogK)\n\n# Complexity\n- Time complexity: O(NlogK)\n\n# Code\n\nclass Solution {\n    public int kth
Since PriorityQueue is with size of k, the complexity is O(NlogK)\n\n# Complexity\n- Time complexity: O(NlogK)\n\n# Code\n```\nclass Solution {\n    public int kthLargestValue(int[][] m, int k) {\n        PriorityQueue<Integer> pq = new PriorityQueue<>();\n        int a = m.length, b = m[0].length;\n\n        for (int i = 0; i < a; i++) {\n            for (int j = 1; j < b; j++) {\n                m[i][j] ^= m[i][j - 1];\n            }\n        }\n        for (int i = 0; i < b; i++) {\n            pq.offer(m[0][i]);\n            if (pq.size() > k) pq.poll();\n        }\n        for (int j = 0; j < b; j++) {\n            for (int i = 1; i < a; i++) {\n                m[i][j] ^= m[i - 1][j];\n                pq.offer(m[i][j]);\n                if (pq.size() > k) pq.poll();\n            }\n        }\n        return pq.poll();\n    }\n}\n```
['Java']