https://www.geeksforgeeks.org/find-rectangle-binary-matrix-corners-1/

  1. Scan top down, line by line
  2. For each line, find all column pairs with value 1.Check if such pair already exists in the hashset.
    1. Return true if already exist.
    2. Otherwise add the pair to the hashset.

O(mn^2): m rows, and n^2 for finding pairs in each row

results matching ""

    No results matching ""