C++ | Simple O(N) two pass solution
Find max possible square out of all rectangles\n2. Find all rectangles matching max square found in step 1\n\nclass Solution {\npublic:\n    int countGoodRectan
1. Find max possible square out of all rectangles\n2. Find all rectangles matching max square found in step 1\n```\nclass Solution {\npublic:\n    int countGoodRectangles(vector<vector<int>>& rectangles) {\n        int cnt = 0;\n        int maxLen = 0;\n        for (auto it: rectangles) {\n            int len = min(it[0], it[1]);\n            maxLen = max(maxLen, len);\n        }\n        for (auto it: rectangles) {\n            int len = min(it[0], it[1]);\n            if (len == maxLen)\n                cnt++;\n        }\n        return cnt;\n    }\n};\n```
['C']