#include using namespace std;  int countCornerRectangles(    vector& mat){        int count = 0;      int N = mat.size();    int M = mat[0].size();          map m;          for (int i = 0; i < N; i++) {                  for (int j = 0; j < M; j++) {            if (mat[i][j] == 1) {                                                  for (int k = j + 1;                     k < M; k++) {                    if (mat[i][k] == 1) {                        m[{ j, k }]++;                    }                }            }        }    }                  for […]

Continue Reading