C++ | Intuitive
Intuition\n Describe your first thoughts on how to solve this problem. \nFinding length and width of insersection.\n\n# Approach\n Describe your approach to sol
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nFinding length and width of insersection.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n- Assume first rectangle is always on the left of second rectangle.\n- We will consider (i, j) and (j, i) as 2 different pair. Our first assumption will be true for either 1st or 2nd permutation.\n- For Visualization: our each rectangle is made of two vertical and two horizontal lines. Let\'s name left and right vertical line as V1, V2 and bottom and top horizontal lines as H1, H2.\n- For Two Rectangles A(AV1, AV2, AH1, AH2) and B(BV1, BV2, BH1, BH2):\n    Intersecting Legth will be **min(BV2, AV2) - max(BV1, AV1)** if greater than 0, else 0.\nYou can compute the width similliarily.\n\n# Complexity\n- Time complexity: **O(n^2)**\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: **O(1)**\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    long long largestSquareArea(vector<vector<int>>& BL, vector<vector<int>>& TR) {\n        long long ans = 0;\n        int n = BL.size();\n        for (int i=0; i <n; i++) {\n            for (int j=0; j<n; j++) {\n                if (i==j) continue;\n\n                long long l = max(0, min(TR[j][0], TR[i][0]) -  max(BL[j][0], BL[i][0]));\n                long long b = max(0, min(TR[j][1], TR[i][1]) -  max(BL[j][1], BL[i][1]));\n                l = min(l, b);\n                ans = max(ans, 1LL*l*l);\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']