Submission Result: Wrong Answer More Details

Input:

-2

-2

2

2

3

3

4

4

Output:

0

Expected:

17

The input has no overlapping region, so the answer should be 0, but the system return 17.

P.S my answer is:

public class Solution {

public int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) {

```
if(A == C && B == D) {
return (G-E)*(H-F);
}
if(G == E && H == F) {
return (C-A)*(D-B);
}
int lx = Math.max(A, E);
int rx = Math.min(C, G);
int uy = Math.min(D, H);
int by = Math.max(F, B);
if(lx >= rx || uy <= by) {
return 0;
} else {
return (rx - lx) * (uy - by);
}
}
```

}