Tap here to switch tabs
Problem
Submissions

Problem: Score After Flipping Matrix

med
30 min
Try to solve the Score After Flipping Matrix problem.

Statement

You are given an m by n binary matrix grid.

A move consists of selecting any row or column and toggling every value in it, changing all 00’s to 11’s and all 11’s to 00’s.

Each row of the matrix represents a binary number. The score of the matrix is defined as the sum of these binary numbers across all rows.

Return the maximum possible score achievable after performing any number of moves.

Constraints:

  • m ==== grid.length

  • n ==== grid[i].length

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

  • grid[i][j] is either 00 or 11.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Score After Flipping Matrix

med
30 min
Try to solve the Score After Flipping Matrix problem.

Statement

You are given an m by n binary matrix grid.

A move consists of selecting any row or column and toggling every value in it, changing all 00’s to 11’s and all 11’s to 00’s.

Each row of the matrix represents a binary number. The score of the matrix is defined as the sum of these binary numbers across all rows.

Return the maximum possible score achievable after performing any number of moves.

Constraints:

  • m ==== grid.length

  • n ==== grid[i].length

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

  • grid[i][j] is either 00 or 11.