Tap here to switch tabs
Problem
Submissions

Problem: Minimum Bitwise OR From Grid

Try to solve the Minimum Bitwise OR From Grid problem.

Statement

You are given a 2D2 {D} integer array grid of size m $ imes$ n.

You need to select exactly one integer from each row of grid.

Return the minimum possible bitwise OR{OR} sum of the chosen elements.

Constraints:

  • 1≤1 \leq m ==== grid.length ≤105\leq 10^5

  • 1≤1 \leq n ==== grid[i].length ≤105\leq 10^5

  • m ×\times n ≤105\leq 10^5

  • 1≤1 \leq grid[i][j] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Bitwise OR From Grid

Try to solve the Minimum Bitwise OR From Grid problem.

Statement

You are given a 2D2 {D} integer array grid of size m $ imes$ n.

You need to select exactly one integer from each row of grid.

Return the minimum possible bitwise OR{OR} sum of the chosen elements.

Constraints:

  • 1≤1 \leq m ==== grid.length ≤105\leq 10^5

  • 1≤1 \leq n ==== grid[i].length ≤105\leq 10^5

  • m ×\times n ≤105\leq 10^5

  • 1≤1 \leq grid[i][j] ≤105\leq 10^5