Simple Python Solution
\n\n\nclass Solution:\n    def kthLargestValue(self, A, k):\n        row, col = len(A), len(A[0])\n        dp = [[0 for _ in range(col)] for _ in range(row)]\n 
![image](https://assets.leetcode.com/users/images/10653d1a-b748-478f-bc92-f3e4dc108596_1611489427.893352.png)\n\n```\nclass Solution:\n    def kthLargestValue(self, A, k):\n        row, col = len(A), len(A[0])\n        dp = [[0 for _ in range(col)] for _ in range(row)]\n        dp[0][0] = A[0][0]\n        \n        for c in range(1, col):\n            dp[0][c] = A[0][c]^dp[0][c-1]\n        \n        for r in range(1, row):\n            dp[r][0] = A[r][0]^dp[r-1][0]\n        \n        for r in range(1, row):\n            for c in range(1, col):\n                dp[r][c] = dp[r][c-1]^dp[r-1][c]^dp[r-1][c-1]^A[r][c]\n        \n        array = []\n        for i in range(row):\n            for j in range(col):\n                array.append(dp[i][j])\n        \n        if len(array) < k: return 0\n        array.sort(reverse=True)\n        return array[k-1]\n```\n\nTime: O(row x col)\nSpace: O(row x col)
['Dynamic Programming', 'Python']