C++ || Easy to understand & implement
Edge Case\n\nMentioning the case which I have used inside \'if\' condition in my code:\nIn final obtained overlapping square-\nPlease check if topRightX > botto
# Edge Case\n```\nMentioning the case which I have used inside \'if\' condition in my code:\nIn final obtained overlapping square-\nPlease check if topRightX > bottomLeftX && topRightY > bottomRightY\n```\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n```\nO(N^2)\n```\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n```\nO(1)\n```\n\n# Code\n```\nclass Solution {\npublic:\n    long long largestSquareArea(vector<vector<int>>& bottomLeft, vector<vector<int>>& topRight) {\n        long long int n=bottomLeft.size();\n        long long int area=0;\n        for(long long int i=0;i<n;i++){\n            for(long long int j=(i+1);j<n;j++){\n                long long int leftx= max(bottomLeft[i][0],bottomLeft[j][0]);\n                long long int lefty= max(bottomLeft[i][1],bottomLeft[j][1]);\n                long long int rightx= min(topRight[i][0],topRight[j][0]);\n                long long int righty=min(topRight[i][1],topRight[j][1]);\n                if((rightx-leftx)>0 && (righty-lefty)>0){\n                    long long int minWidth=min((abs(rightx-leftx)),(abs(righty-lefty)));\n                    area=max(area,minWidth*minWidth);\n                }\n            }\n        }\n        return area;\n    }\n};\n```
['Math', 'C++']