Javascript - Loop
Code\n\n/**\n * @param {number[][]} bottomLeft\n * @param {number[][]} topRight\n * @return {number}\n */\nvar largestSquareArea = function (bottomLeft, topRigh
# Code\n```\n/**\n * @param {number[][]} bottomLeft\n * @param {number[][]} topRight\n * @return {number}\n */\nvar largestSquareArea = function (bottomLeft, topRight) {\n  let ans = 0;\n  const n = bottomLeft.length;\n  for (let i = 0; i < n; i++) {\n    for (let j = i + 1; j < n; j++) {\n      const x1 = Math.max(bottomLeft[i][0], bottomLeft[j][0]);\n      const x2 = Math.min(topRight[i][0], topRight[j][0]);\n      const y1 = Math.max(bottomLeft[i][1], bottomLeft[j][1]);\n      const y2 = Math.min(topRight[i][1], topRight[j][1]);\n\n      if (x2 > x1 && y2 > y1) {\n        const min = Math.min(x2 - x1, y2 - y1);\n        ans = Math.max(ans, min * min);\n      }\n    }\n  }\n\n  return ans;\n};\n\n```
['JavaScript']