Having Hard time, Come with me.
Intuition\nSolve the below questions to get the intiution:\n1) Rectangle overlap [Easy]\n2) Rectangle Area [Medium]\n3) Other Geometry Tag questions.\nIf you so
# Intuition\nSolve the below questions to get the intiution:\n1) Rectangle overlap [Easy]\n2) Rectangle Area [Medium]\n3) Other Geometry Tag questions.\nIf you solved these questions then it will be easy to solve this one for anyone.\n```\nNote: we can represent any rectangle with bottom left coordinates\nand top right coordinates.\n```\n# Approach\n Just find intersecting area for each rectangle with all rectangles that come next of current rectangle, simple O(n^2).\n\nFor intersecting rectangle formula used here, you have to dry run the code to understand it. Explaining here will not help.\n\n``Note: this is the only way to solve this question.``\n# Complexity\n- Time complexity:\nO(n^2)\n- Space complexity:\nO(1)\n\n# Test case to dry run:\n```\nbottomLeft=[[1,1],[2,2],[2,4],[0,0]]\ntopRight=[[5,6],[4,3],[6,5],[2,2]]\nabove test case may be invalid but it is help ful to dry run.\n```\n`` With this test case dry run your will get clear understanding``\n\n![Screenshot 2024-02-27 183854.png](https://assets.leetcode.com/users/images/f3a47604-426a-4136-92ee-bc31e5a922a9_1709039388.6861463.png)\n\n``UtilLink:https: //www.mathed.page/geoboard/grid-paper/index.html``\n\n# Code\n```\n#define sqr(a) (long long)((long long)(a)*(long long)(a))\n\nclass Solution {\npublic:\n//process each rectangle with all rectangles after the current rectangle in the array.\n//apply formula for finding intersection of two rectangle and check if this intersection is valid or not.\n\n    long long largestSquareArea(vector<vector<int>>& btmLftCoordinates, vector<vector<int>>& topRightCoordinates) {\n        long long area=0;\n        int n=btmLftCoordinates.size();\n        \n        for(int i=0;i<n;i++){\n            for(int j=i+1;j<n;j++){\n               int bottomLeftXOfIntersectingRectangle=max(btmLftCoordinates[i][0],btmLftCoordinates[j][0]);\n               int bottomLeftYOfIntersectingRectangle=max(btmLftCoordinates[i][1],btmLftCoordinates[j][1]);\n               int topRightXOfIntersectingRectangle=min(topRightCoordinates[i][0],topRightCoordinates[j][0]);\n               int topRightYOfIntersectingRectangle=min(topRightCoordinates[i][1],topRightCoordinates[j][1]);\n               \n               //check if the found intersecting RECTANGLE is valid or not.\n               if(bottomLeftXOfIntersectingRectangle<topRightXOfIntersectingRectangle&&\n                  bottomLeftYOfIntersectingRectangle<topRightYOfIntersectingRectangle\n                 ){\n                //we could get intersecting rectangle area instead of square area with slight changes here.\n                  area=max(area,(long long)min(//to get squared from the rectangle if rectangle is found in intersection\n                        sqr(topRightXOfIntersectingRectangle-bottomLeftXOfIntersectingRectangle),\n                        sqr(topRightYOfIntersectingRectangle-bottomLeftYOfIntersectingRectangle)\n                     )\n                     );\n                 }\n            }\n        }\n        return area;//area has side of square now return side*side\n    }\n};\n//little Input optimization, you may ignore.\nauto init = []() {\n    ios::sync_with_stdio(false);\n    cin.tie(nullptr);\n    cout.tie(nullptr);\n    return \'c\';\n}();\n```
['Math', 'Geometry', 'C++']