#3240

Minimum Number of Flips to Make Binary Grid Palindromic II

expert · 1175 · lc medium +32 · 25.5% accepted · 142 likes · top 4%

Description

You are given m x n binary matrix grid. You may flip any cells. Return the minimum flips needed so that all rows and all columns are palindromic and the total count of 1s is divisible by 4.

Code

1
2
3