EASY C++ 100% O(N) Brute Force
Approach\n Describe your approach to solving the problem. Brute Force. \n# Complexity\n- Time complexity: O(n) \n\n- Space complexity: O(1) \n\n# Code\ncpp []\n
# Approach\n<!-- Describe your approach to solving the problem. -->Brute Force. \n# Complexity\n- Time complexity: $$O(n)$$ \n\n- Space complexity: $$O(1)$$ \n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int areaOfMaxDiagonal(vector<vector<int>>& dimensions) {\n        int area = 0, diag = 0;\n        for(int i = 0; i < dimensions.size(); i++) {\n            int currDiag = dimensions[i][0]*dimensions[i][0]\n                        + dimensions[i][1]*dimensions[i][1];\n            if(currDiag > diag) { \n                area = dimensions[i][0]*dimensions[i][1];\n                diag = currDiag;\n            }\n            else if(currDiag == diag) {\n                int currArea = dimensions[i][0]*dimensions[i][1];\n                area = max(currArea,area);\n            }\n        }\n        return area;\n    }\n};\n```
['C++']