- Bit Magic, Greedy, Matrix

Minimum operations to convert Binary Matrix A to B by flipping submatrix of size K

#include using namespace std;  int minMoves(vector a,             vector b,             int K){        int n = a.size(), m = a[0].size();            int cntOperations = 0;          for (int i = 0; i < n; i++) {          for (int j = 0; j < m; j++) {                                        if (a[i][j] != b[i][j]) {                                                    cntOperations++;                                                                      if (i + K - 1 >= n                    || j + K – 1 >= m) {                    return -1;                }                                                  for (int p = 0;                      p