Minimum Number of Flips to Convert Binary Matrix to Zero Matrix at Airbnb

Hard72.4% acceptance

This problem has 75.0% frequency at Airbnb.

Problem Description

Given a `m x n` binary matrix `mat`. In one step, you can choose one cell and flip it and all the four neighbors of it if they exist (Flip is changing `1` to `0` and `0` to `1`). A pair of cells are called neighbors if they share one edge. Return the _minimum number of steps_ required to convert `m...

Read full problem and hints

Topics


More Airbnb Questions

View all Airbnb questions