Easy Approach
class Solution {\n    public int kthLargestValue(int[][] matrix, int k) {\n        \n        int m=matrix.length,n=matrix[0].length;\n        for(int i=0;i<m;i+
class Solution {\n    public int kthLargestValue(int[][] matrix, int k) {\n        \n        int m=matrix.length,n=matrix[0].length;\n        for(int i=0;i<m;i++){\n            for(int j=0;j<n;j++){\n                if(i==0&&j!=0){\n                    matrix[i][j]=matrix[i][j-1]^matrix[i][j];\n                }else if(j==0 && i!=0){\n                    matrix[i][j]=matrix[i-1][j]^matrix[i][j];\n                }else if(i!=0&&j!=0){\n                    matrix[i][j]=matrix[i-1][j-1]^matrix[i-1][j]^matrix[i][j-1]^matrix[i][j];\n                }\n            }\n        }\n        \n        List<Integer> l=new ArrayList();\n        \n        for(int i=0;i<m;i++){\n            for(int j=0;j<n;j++){\n                l.add(matrix[i][j]);\n            }\n        }\n        \n        Collections.sort(l);\n        return l.get(l.size()-k);\n        \n    }\n}
[]