Tap here to switch tabs
Problem
Submissions

Problem: Find Kth Largest XOR Coordinate Value

med
30 min
Try to solve the Find Kth Largest XOR Coordinate Value problem.

Statement

You are given a two dimensional integer array matrix of size m $ imes$ n, and an integer k.

The XOR coordinate value of a cell (a,b)(a, b) is computed as the bitwise XOR sum of all elements matrix[i][j] where 0≤i≤a0 \leq i \leq a and 0≤j≤b0 \leq j \leq b (00 indexed).

Return the kth largest XOR coordinate value (11 indexed) among all possible coordinates (a,b)(a, b) where 0≤a<0 \leq a < m and 0≤b<0 \leq b < n.

Constraints:

  • m == matrix.length

  • n == matrix[i].length

  • 1≤1 \leq m, n ≤1000\leq 1000

  • 0≤0 \leq matrix[i][j] ≤106\leq 10^6

  • 1≤1 \leq k ≤\leq m $ imes$ n

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find Kth Largest XOR Coordinate Value

med
30 min
Try to solve the Find Kth Largest XOR Coordinate Value problem.

Statement

You are given a two dimensional integer array matrix of size m $ imes$ n, and an integer k.

The XOR coordinate value of a cell (a,b)(a, b) is computed as the bitwise XOR sum of all elements matrix[i][j] where 0≤i≤a0 \leq i \leq a and 0≤j≤b0 \leq j \leq b (00 indexed).

Return the kth largest XOR coordinate value (11 indexed) among all possible coordinates (a,b)(a, b) where 0≤a<0 \leq a < m and 0≤b<0 \leq b < n.

Constraints:

  • m == matrix.length

  • n == matrix[i].length

  • 1≤1 \leq m, n ≤1000\leq 1000

  • 0≤0 \leq matrix[i][j] ≤106\leq 10^6

  • 1≤1 \leq k ≤\leq m $ imes$ n