Rust || beats 100% || 0ms
Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(n)\n\n# Code\n\nimpl Solution {\n    pub fn count_good_rectangles(rectangles: Vec<Vec<i32>>) -> i32
# Complexity\n- Time complexity: $$O(n)$$\n\n- Space complexity: $$O(n)$$\n\n# Code\n```\nimpl Solution {\n    pub fn count_good_rectangles(rectangles: Vec<Vec<i32>>) -> i32 {\n        let mut max_side = 0;\n        let mut count = 0;\n        for rect in rectangles.iter() {\n            let mut side = std::cmp::min(rect[0], rect[1]);\n            if max_side == side {\n                count += 1;\n            } else if side > max_side {\n                max_side = side;\n                count = 1;\n            }\n        }\n        count\n    }\n}\n```
['Rust']