One loop
Intuition\n Describe your first thoughts on how to solve this problem. \nKeep the best answer in one loop.\n\n### Approach\n Describe your approach to solving t
### Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nKeep the best answer in one loop.\n\n### Approach\n<!-- Describe your approach to solving the problem. -->\nUse tuple `[diagonal , area]` to keep the best result so far.\n\n### Complexity\n- Time complexity: $$O(N)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n### Code\n```\nclass Solution {\n  public int areaOfMaxDiagonal(int[][] dimensions) {\n    // [diagonal , area]\n    int[] best = new int[2];\n    for (int[] d : dimensions) {\n      int p = d[0] * d[0] + d[1] * d[1];\n      if (p > best[0] || (p == best[0] && d[0] * d[1] > best[1])) {\n        best[0] = p;\n        best[1] = d[0] * d[1];\n      }\n    }\n\n    return best[1];\n  }\n}\n\n```
['Java']