Easy To Read Implementation | Calculate Intersection Points | O(n^2)
\nclass Solution {\n    private long sqArea(int[] bLeft1,int[] bLeft2, int[] tRight1,int[] tRight2){\n        int[][] res = new int[2][2];\n        res[0][0] = 
```\nclass Solution {\n    private long sqArea(int[] bLeft1,int[] bLeft2, int[] tRight1,int[] tRight2){\n        int[][] res = new int[2][2];\n        res[0][0] = Math.max(bLeft1[0],bLeft2[0]);\n        res[0][1] = Math.max(bLeft1[1],bLeft2[1]);\n        res[1][0] = Math.min(tRight1[0],tRight2[0]);\n        res[1][1] = Math.min(tRight1[1],tRight2[1]);\n        \n        long len1  = res[1][0]-res[0][0];\n        long len2 = res[1][1]-res[0][1];\n        \n        len1 =  Math.min(len1,len2);\n        \n        if(len1<0)return len1;\n        return len1*len1;\n        \n    }\n    public long largestSquareArea(int[][] bottomLeft, int[][] topRight) {\n        long max = 0;\n        int len = bottomLeft.length;\n        for(int i=0;i<len;i++)\n            for(int j=i+1;j<len;j++){\n                max  = Math.max(max, sqArea(bottomLeft[i],bottomLeft[j],topRight[i],topRight[j]));\n            }\n        return max;\n    }\n}\n```
['Java']