⭐️  [ Kt, Js, Py3, Cpp ] 🎯 Best == Max of Min(length, width)
\n   Synopsis:\n\n1. Find the best square length as the maximum of the minimum of each rectangle\'s length l and width w\n2. Return the count of rectangles with
\n   **Synopsis:**\n\n1. Find the `best` square length as the maximum of the minimum of each rectangle\'s length `l` and width `w`\n2. Return the count of rectangles with length `l` and width `w` greater-than `best`\n\n---\n\n*Kotlin*\n```\nclass Solution {\n    fun countGoodRectangles(A: Array<IntArray>): Int {\n        var best = A.map{ (l, w) -> Math.min(l, w) }!!.max()!!\n        return A.filter{ (l, w) -> best <= l && best <= w }.size\n    }\n}\n```\n\n*Javascript*\n```\nlet countGoodRectangles = A => {\n    let best = Math.max(...A.map(([l, w]) => Math.min(l, w)));\n    return A.filter(([l, w]) => best <= l && best <= w).length;\n};\n```\n\n*Javascript: 1-liner... just for fun! :)*\n```\nlet countGoodRectangles = (A, best = Math.max(...A.map(([l, w]) => Math.min(l, w)))) => A.filter(([l, w]) => best <= l && best <= w).length;\n```\n\n\n*Python3*\n```\nclass Solution:\n    def countGoodRectangles(self, A: List[List[int]]) -> int:\n        best = max(min(l, w) for l, w in A)\n        return len([l for l, w in A if best <= l and best <= w])\n```\n\n*C++*\n```\nclass Solution {\npublic:\n    using VI = vector<int>;\n    using VVI = vector<VI>;\n    int countGoodRectangles(VVI& A, int best = 0) {\n        for (auto& rect: A)\n            best = max(best, min(rect[0], rect[1]));\n        return count_if(A.begin(), A.end(), [=](auto& rect) {\n            return best <= rect[0] && best <= rect[1];\n        }); \n    }\n};\n```\n
[]