Brute-Force Solution C++ [beats 33.33%]
Complexity\n- Time complexity:  O(n^2)\n\n- Space complexity:  O(n)\n\n# Code\n\n/*\n(1, 3), (2, 4), (3, 6)\n(1, 3), (2, 4), (1, 6)\n*/\n\nusing ll = long long;
# Complexity\n- Time complexity:  $$O(n^2)$$\n\n- Space complexity:  $$O(n)$$\n\n# Code\n```\n/*\n(1, 3), (2, 4), (3, 6)\n(1, 3), (2, 4), (1, 6)\n*/\n\nusing ll = long long; \n\nclass Solution {\npublic:\n    long long largestSquareArea(vector<vector<int>>& bottomLeft, vector<vector<int>>& topRight) {\n        ll ans = 0;\n        int n = bottomLeft.size();\n        vector<pair<pair<int, int>, pair<int, int>>> vec;\n        for(int i=0; i<n; i++) {\n            vec.push_back({{bottomLeft[i][0], topRight[i][0]}, {bottomLeft[i][1], topRight[i][1]}});\n        }\n        sort(vec.begin(), vec.end());\n        for(int i=0; i<n; i++) {\n            for(int j=i+1; j<n; j++) {\n                pair<int, int> x1 = vec[i].first;\n                pair<int, int> y1 = vec[i].second;\n                pair<int, int> x2 = vec[j].first;\n                pair<int, int> y2 = vec[j].second;\n                if(x1.second < x2.first || y1.second < y2.first) continue;\n                int diffX = (x1.second - x1.first) - max(x2.first - x1.first, 0) - max(x1.second - x2.second, 0);\n                int diffY = (y1.second - y1.first) - max(y2.first - y1.first, 0) - max(y1.second - y2.second, 0);\n                int var = min(diffX, diffY);\n                ans = (ans < var ? var : ans);\n            }\n        }\n        return ans * ans;\n    }\n};\n```
['C++']