Order by x, then check overlap
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```csharp []
public class Solution {
    public class Rect2
    {
        public int bl_x;
        public int bl_y;
        public int tr_x;
        public int tr_y;

        public Rect2(int[] p1, int[] p2)
        {
            bl_x = p1[0];
            bl_y = p1[1];
            tr_x = p2[0];
            tr_y = p2[1];
        }
    }

    private int CommSize(Rect2 r1, Rect2 r2)
    {
        int blx1 = r1.bl_x, bly1 = r1.bl_y, trx1 = r1.tr_x, try1 = r1.tr_y;
        int blx2 = r2.bl_x, bly2 = r2.bl_y, trx2 = r2.tr_x, try2 = r2.tr_y;
        int tlx2 = r2.bl_x, tly2 = try2;
        int maxLen = 0;
        // No overlap, simply return 0;
        if(bly2 >= try1 || try2 <= bly1)
            return 0;

        int commLx = Math.Max(blx1, blx2), commLy = Math.Max(bly1, bly2);
        int commRx = Math.Min(trx1, trx2), commRy = Math.Min(try1, try2);
        maxLen = Math.Max(maxLen, Math.Min(commRx-commLx, commRy-commLy));

        return maxLen;
    }

    public long LargestSquareArea(int[][] bottomLeft, int[][] topRight) {
        int len = bottomLeft.Length;
        Rect2[] rects = new Rect2[len];
        for(int i = 0; i < len; i++)
        {
            rects[i] = new Rect2(bottomLeft[i], topRight[i]);
        }

        rects = rects.OrderBy(x=>x.bl_x).ThenBy(x=>x.bl_y).ToArray();
        long maxL = 0;
        for(int i = 0; i < len-1; i++)
        {
            int idx = i+1;
            while(idx < len && rects[idx].bl_x < rects[i].tr_x)
            {
                int commL = CommSize(rects[i], rects[idx++]);
                maxL = Math.Max(maxL, commL);
            }
        }

        return maxL*maxL;
    }
}
```
['C#']