Leetcode 1843 Solution
This article provides solution to leetcode question 1843 (number-of-rectangles-that-can-form-the-largest-square)
Access this page by simply typing in "lcs 1843" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/number-of-rectangles-that-can-form-the-largest-square
Solution
class Solution:
def countGoodRectangles(self, rectangles: List[List[int]]) -> int:
d = [min(l, w) for l, w in rectangles]
return sum([x == max(d) for x in d])