https://youtu.be/77H-uofI1jY?si=Ie8WcAGrkVRprrF4
\nclass Solution {\npublic:\n    long long intersect(vector &bottomLeft1,vector &bottomLeft2,vector & topRight1,vector & topRight2){\n\n     // min of toprights
\nclass Solution {\npublic:\n    long long intersect(vector<int> &bottomLeft1,vector<int> &bottomLeft2,vector<int> & topRight1,vector<int> & topRight2){\n\n     // min of toprights\n     int x1=min(topRight1[0],topRight2[0]);\n     int y1=min(topRight1[1],topRight2[1]);\n\n     // max of two bottomLefts\n     int x2=max(bottomLeft1[0],bottomLeft2[0]);\n     int y2=max(bottomLeft1[1],bottomLeft2[1]);\n\n    // not intersecting\n    if(x2>=x1 || y2>=y1){\n        return 0;\n    }\n\n    long long side=min(x1-x2,y1-y2);\n    return side*side;\n\n    }\n    long long largestSquareArea(vector<vector<int>>& bottomLeft, vector<vector<int>>& topRight) {\n        int n=bottomLeft.size();\n        long long ansMax=0;\n        for(int i=0;i<n;i++){\n            for(int j=i+1;j<n;j++){\n                long long area=intersect(bottomLeft[i],bottomLeft[j],topRight[i],topRight[j]);\n                 ansMax=(ansMax>area)?ansMax:area;\n            }\n        }\n        return ansMax;\n    }\n};\n```
['C++']