Easy Video Explanation (with Visuals) 🔥 || Math
Intuition\n Describe your first thoughts on how to solve this problem. \nUse correct data types while validating the results\n\n\n# Easy Video Explanation\nhttp
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nUse correct data types while validating the results\n\n\n# ***Easy Video Explanation***\nhttps://youtu.be/PKkmkzOVZbI\n\n\n\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nThe code calculates the Euclidean distance for each vector in a 2D array. It finds the vector with the maximum distance, considering ties by choosing the one with the maximum product of its components. The result represents the area of the rectangle formed by the vector in the 2D plane.\n\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n    O(N)\n    \n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n    O(1)\n    \n\n# Code\n\n\n```C++ []\nclass Solution {\npublic:\n    int areaOfMaxDiagonal(vector<vector<int>>& v) {\n        int n=v.size();\n        int ans=0;\n        double d=0;\n        for(int i=0;i<n;i++) {\n            double t=sqrt(v[i][0]*v[i][0]+v[i][1]*v[i][1]);\n            //cout<<i<<" "<<t<<endl;\n            if(t>=d) {\n                if(t==d)\n                    ans=max(ans,v[i][0]*v[i][1]);\n                else\n                    ans=v[i][0]*v[i][1];\n                d=t;\n            }\n        }\n        return ans;\n    }\n};\n```\n```python []\nfrom typing import List\n\nclass Solution:\n    def areaOfMaxDiagonal(self, v: List[List[int]]) -> int:\n        n = len(v)\n        ans = 0\n        d = 0\n        for i in range(n):\n            t = (v[i][0] ** 2 + v[i][1] ** 2) ** 0.5\n            if t >= d:\n                if t == d:\n                    ans = max(ans, v[i][0] * v[i][1])\n                else:\n                    ans = v[i][0] * v[i][1]\n                d = t\n        return ans\n\n```\n```Java []\nimport java.util.List;\n\nclass Solution {\n    public int areaOfMaxDiagonal(List<List<Integer>> v) {\n        int n = v.size();\n        int ans = 0;\n        double d = 0;\n        for (int i = 0; i < n; i++) {\n            double t = Math.sqrt(v.get(i).get(0) * v.get(i).get(0) + v.get(i).get(1) * v.get(i).get(1));\n            if (t >= d) {\n                if (t == d)\n                    ans = Math.max(ans, v.get(i).get(0) * v.get(i).get(1));\n                else\n                    ans = v.get(i).get(0) * v.get(i).get(1);\n                d = t;\n            }\n        }\n        return ans;\n    }\n}\n\n\n```\n\n# ***If you like the solution Please Upvote and subscribe to my youtube channel***\n***It Motivates me to record more videos***\n\n*Thank you* \uD83D\uDE00
['Math', 'Python', 'C++', 'Java']