C++ solution using DP
Solution : In simple 2D DP\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tclass Solution {\n\t\t\t\tpublic:\n\t\t\t\t\tint kthLargestValue(vector>& matrix, int k) {\n\t\t\t
Solution : In simple 2D DP\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tclass Solution {\n\t\t\t\tpublic:\n\t\t\t\t\tint kthLargestValue(vector<vector<int>>& matrix, int k) {\n\t\t\t\t\t\tint n = matrix.size();\n\t\t\t\t\t\tint m = matrix[0].size();\n\n\t\t\t\t\t\tint mt[n][m];\n\t\t\t\t\t\tmemset(mt,0,sizeof(mt));\n\n\n\t\t\t\t\t\tfor(int i = 0;i<n;i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor(int j = 0;j<m;j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(i==0 and j==0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmt[i][j] = matrix[i][j];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(i==0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmt[i][j] = matrix[i][j]^mt[i][j-1];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(j==0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmt[i][j] =  matrix[i][j] ^ mt[i-1][j];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmt[i][j] = matrix[i][j]^mt[i-1][j]^mt[i][j-1]^mt[i-1][j-1];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvector<int>a;\n\t\t\t\t\t\tfor(int i = 0;i<n;i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor(int j = 0;j<m;j++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t   // cout<<mt[i][j]<<" ";\n\t\t\t\t\t\t\t\ta.push_back(mt[i][j]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//cout<<endl;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsort(a.rbegin(),a.rend());\n\n\t\t\t\t\t\treturn a[k-1];\n\t\t\t\t\t}\n\t\t\t\t};
[]