Easy C++ loop without sqrt||11ms Beats 100.00%
Intuition\n Describe your first thoughts on how to solve this problem. \nNo need for computing sqrt.\n# Approach\n Describe your approach to solving the problem
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nNo need for computing sqrt.\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1 pass\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n)$$\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(1)$$\n# Code\n```\n#pragma GCC optimize("O3", "unroll-loops")\nclass Solution {\npublic:\n    int areaOfMaxDiagonal(vector<vector<int>>& dimensions) {\n        int maxArea=0, Mdia2=0;\n        for (auto& r: dimensions){\n            int w=r[0], h=r[1], dia2=w*w+h*h;\n            if (Mdia2 < dia2){\n                Mdia2 = dia2;\n                maxArea=0;\n            }\n            if (dia2 == Mdia2)\n                maxArea=max(maxArea, w*h);\n        }\n        return maxArea;\n    }\n};\n\n```
['C++']