Easy Java Solution || Intersections
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n\n    static long helper(int b1[], int t1[], int b2[], int t2[]){\n\n        long left = Math.max((long)b1[0],(long)b2[0]);\n        long right = Math.min((long)t1[0],(long)t2[0]);\n        \n        long down = Math.max((long)b1[1],(long)b2[1]);\n        long top = Math.min((long)t1[1],(long)t2[1]);\n\n        if(left<=right && down<=top){\n            long s = Math.min(right-left,top-down);\n            return s*s;\n        }\n        return 0;\n    }\n    public long largestSquareArea(int[][] bt, int[][] tp) {\n        int n = bt.length;\n\n        long ans = 0;\n\n        for(int i=0; i<n; i++){\n            for(int j=i+1; j<n; j++){\n                ans = Math.max(ans,helper(bt[i],tp[i],bt[j],tp[j]));\n            }\n        }\n        return ans;\n    }\n}\n```
['Java']