High-Performance Solution | 95.98% Runtime Efficiency🔥🔥
Intuition\n Describe your first thoughts on how to solve this problem. \nwe will be iterating through the 2D array and find out the diagonal length using basic 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nwe will be iterating through the 2D array and find out the diagonal length using basic sqrt and pow methods and update the maximum diagonal length and area, finally return the max area.\n# Approach\n<!-- Describe your approach to solving the problem. -->\nsimple linear searching through the dimensions array.\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(r), where r is the number of rectangles in the dimensions\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1) \n\n# Code\n```java []\nclass Solution {\n    public int areaOfMaxDiagonal(int[][] dimensions) {\n        int r=dimensions.length;\n        double maxdiaglength=0;\n        int maxarea=0;\n        for(int i=0;i<r;i++)\n        {\n            double diaglength=Math.sqrt(Math.pow(dimensions[i][0],2)+Math.pow(dimensions[i][1],2));\n            int area=dimensions[i][0]*dimensions[i][1];\n            if(diaglength>maxdiaglength || (diaglength==maxdiaglength && area>maxarea))\n            {\n                maxdiaglength=diaglength;\n                maxarea=area;\n            }\n        }\n        return maxarea;\n    }\n}\n```
['Java']