JavaScript Time O(n) Space O(n) with HashTable
Approach\nSearch through each rectangles, find the smaller side, and add one to the count number(With hash), compare to the maximum width. Return the count numb
# Approach\nSearch through each rectangles, find the smaller side, and add one to the count number(With hash), compare to the maximum width. Return the count number of the largest width.\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * @param {number[][]} rectangles\n * @return {number}\n */\nvar countGoodRectangles = function(rectangles) {\n    let widthHash = {}\n    let maxWidth = 0\n\n    for(let rectangle of rectangles){\n        let min = Math.min(rectangle[0], rectangle[1])\n        addToHash(min)\n        setMax(min)\n    }\n\n    return widthHash[maxWidth]\n\n    function addToHash(val){\n        if(!widthHash[val]){\n            widthHash[val] = 1\n        }else{\n            widthHash[val]++\n        }\n    }\n\n    function setMax(val){\n        if(val > maxWidth){\n            maxWidth = val\n        }\n    }\n    \n};\n```
['JavaScript']