Python - Runtime O(N) and O(1) space [ACCEPTED]
This can be done just by tracking the max length and its count.\n\n```\ndef countGoodRectangles(rectangles):\n\tmax_len = float(\'-inf\')\n\tcount = 0\n\tfor it
This can be done just by tracking the max length and its count.\n\n```\ndef countGoodRectangles(rectangles):\n\tmax_len = float(\'-inf\')\n\tcount = 0\n\tfor item in rectangles:\n\t\tmin_len = min(item)\n\t\tif min_len == max_len:\n\t\t\tcount += 1\n\t\telif min_len > max_len:\n\t\t\tmax_len = min_len\n\t\t\tcount = 1\n\n\treturn count
['Python3']