C++ code in linear time || Faster then others
\n\n# Complexity\n- Time complexity:O(N)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(1)\n Add your space complexity here, e.g. O(n) \n\n
\n\n# Complexity\n- Time complexity:O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int countGoodRectangles(vector<vector<int>>& rectangles) {\n        int max_len=min(rectangles[0][0],rectangles[0][1]),cnt=1;\n        for(int i=1;i<rectangles.size();i++){\n            int min_len= min(rectangles[i][0],rectangles[i][1]);\n            if(min_len==max_len){\n                cnt++;\n            }else if(min_len>max_len){\n                max_len=min_len;\n                cnt=1;\n            }\n        }\n        return cnt;\n\n        \n    }\n};\n```
['C++']