Python One pass
py\n\'\'\'\nw: hashmap + greedy\nh: count the frequency of each maxLen for each rectangle\n    in the meanwhile, record the largest maxLex so far\n    then at t
```py\n\'\'\'\nw: hashmap + greedy\nh: count the frequency of each maxLen for each rectangle\n    in the meanwhile, record the largest maxLex so far\n    then at the end, just return the frequency of the largest maxLen\n\'\'\'\nimport collections\nclass Solution:\n    def countGoodRectangles(self, rectangles: List[List[int]]) -> int:\n        rec = collections.defaultdict(int)\n        maxLen = 0\n        \n        for recta in rectangles:\n            s = min(recta)\n            rec[s] += 1\n            maxLen = max(maxLen, s)\n        \n        return rec[maxLen]\n```
['Greedy', 'Python']