Find Kth Largest
Intuition\nThe goal is to find the k-th largest value of XOR computations for all submatrices starting from the top-left corner (0, 0) to any coordinate (a, b) 
# Intuition\nThe goal is to find the k-th largest value of XOR computations for all submatrices starting from the top-left corner (0, 0) to any coordinate (a, b) in the matrix\n\n# Approach\n1. Prefix XOR computation\n2. Maintain a min-heap for the k-th largest value\n\n# Complexity\n- Time complexity:\nO(m*n*logk) with m number of rows and n number of columns. logk is insertion into the heap\n\n- Space complexity:\nO(m*n + k) for k largest elements\n\n# Code\n```python []\nclass Solution(object):\n    def kthLargestValue(self, matrix, k):\n        """\n        :type matrix: List[List[int]]\n        :type k: int\n        :rtype: int\n        """\n        m = len(matrix)\n        n = len(matrix[0])\n\n        # Initiizalize the prefix XOR array\n        xor_prefix = [[0] * n for _ in range(m)]\n\n        # Min-heap to track the k-th largest value\n        min_heap = []\n        \n        # Fill in the prefix XOR array and track k-th largest values using the heap\n        for i in range(m):\n            for j in range(n):\n                # Calculate the XOR for current cell\n                xor_prefix[i][j] = matrix[i][j]\n                if i > 0:\n                    xor_prefix[i][j] ^= xor_prefix[i-1][j]\n                if j > 0:\n                    xor_prefix[i][j] ^= xor_prefix[i][j-1]\n                if i > 0 and j > 0:\n                    xor_prefix[i][j] ^= xor_prefix[i-1][j-1]\n\n                # Push the value into the min-heap\n                heapq.heappush(min_heap, xor_prefix[i][j])\n                # If heap size exceeds k, remove the smallest element\n                if len(min_heap) > k:\n                    heapq.heappop(min_heap)\n\n        return min_heap[0]\n```
['Python']