Python O(n*m*log(k)) time and O(k) space
Idea: destroy existing matrix calculating prefixes while maintaining minheap of k largest elements\n\nx=m[i][j]*m[i][j-1]*m[i-1][j-1]*m[i-1][j]=x*a*b*c xoring w
Idea: destroy existing matrix calculating prefixes while maintaining minheap of k largest elements\n\n`x=m[i][j]*m[i][j-1]*m[i-1][j-1]*m[i-1][j]=x*a*b*c` xoring will result in value x that will have each element m[0..i][0..j] XORed odd number of times\n```\n prefixes       XORtimes       Equivalent\n|         |    |3 3 1    |    |1 1 1    |\n|    b a  |    |3 3 1    |    |1 1 1    |\n|    c x* | => |1 1 1    | => |1 1 1    |\n|         |    |         |    |         |\n|         |    |         |    |         |\n```\n```\nclass Solution:\n    def kthLargestValue(self, matrix: List[List[int]], k: int) -> int:\n        m = matrix\n        ktracker = []\n        heapify(ktracker)\n        \n        for i, row in enumerate(matrix): # n times\n            for j, el in enumerate(row): # m times\n                a = 0 if i < 1 or j < 1 else m[i-1][j-1]\n                b = 0 if i < 1 else m[i-1][j]\n                c = 0 if j < 1 else m[i][j-1]\n                m[i][j] = m[i][j] ^ a ^ b ^ c\n                \n                heappush(ktracker, m[i][j]) # at most k elements\n                if len(ktracker) > k:\n                    heappop(ktracker)\n        return min(ktracker)\n```
['Python']