Easy CPP Solution
\n\n# Code\n\nclass Solution {\npublic:\n    long long area(int i,int j,vector<vector<int>>& bottomLeft, vector<vector<int>>& topRight)\n    {\n      int x11=bo
\n\n# Code\n```\nclass Solution {\npublic:\n    long long area(int i,int j,vector<vector<int>>& bottomLeft, vector<vector<int>>& topRight)\n    {\n      int x11=bottomLeft[i][0];\n      int y11=bottomLeft[i][1];\n      int x12=topRight[i][0];\n      int y12=topRight[i][1];\n      int x21=bottomLeft[j][0];\n      int y21=bottomLeft[j][1];\n      int x22=topRight[j][0];\n      int y22=topRight[j][1];\n      if (x11>x22 || x21>x12 || y12<y21 || y22<y11) return -1;\n      int x1=0,y1=0,x2=0,y2=0;\n      \n        x1=max(x11,x21);\n        x2=min(x12,x22);\n        y1=max(y11,y21);\n        y2=min(y12,y22);\n        long long mini=min(x2-x1,y2-y1);\n        \n        return mini*mini;\n    \n    }\n    long long largestSquareArea(vector<vector<int>>& bottomLeft, vector<vector<int>>& topRight) {\n        long long ans=0;\n        for (int i=0;i<bottomLeft.size();i++)\n        {\n            for (int j=0;j<bottomLeft.size();j++)\n            {\n                if (i==j) continue;\n              long long cur=area(i,j,bottomLeft,topRight);\n              if (cur>ans) ans=cur;\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']