Beginner friendly JavaScript Solution
Time Complexity : O(n)\n\n/**\n * @param {number[][]} rectangles\n * @return {number}\n */\nvar countGoodRectangles = function(rectangles) {\n    let count = 0,
**Time Complexity : O(n)**\n```\n/**\n * @param {number[][]} rectangles\n * @return {number}\n */\nvar countGoodRectangles = function(rectangles) {\n    let count = 0, max = 0;\n    for(let rec of rectangles){\n        let len = Math.min(rec[0], rec[1]);\n        if(len > max){\n            count = 1;\n            max = len;\n        }else if(len == max){\n            count++;\n        }\n    }\n    return count;\n};\n```
['JavaScript']