Skip to content

Commit 8706eb8

Browse files
committed
Fixed sonar
1 parent 725bb07 commit 8706eb8

File tree

1 file changed

+3
-2
lines changed
  • src/main/java/g3301_3400/s3382_maximum_area_rectangle_with_point_constraints_ii

1 file changed

+3
-2
lines changed

src/main/java/g3301_3400/s3382_maximum_area_rectangle_with_point_constraints_ii/Solution.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public long maxRectangleArea(int[] xCoord, int[] yCoord) {
3232
break;
3333
}
3434
if (y1 == y0 && pair[i + 1].x == pair[i].x && pair[i + 1].y == p1.y) {
35-
long dY = p1.y - y0;
36-
long dX = pair[i].x - p1.x;
35+
long dY = p1.y - (long) y0;
36+
long dX = pair[i].x - (long) p1.x;
3737
best = Math.max(dY * dX, best);
3838
}
3939
if (p1.x != pair[i].x) {
@@ -50,6 +50,7 @@ public long maxRectangleArea(int[] xCoord, int[] yCoord) {
5050
return best;
5151
}
5252

53+
@SuppressWarnings("java:S1210")
5354
private static class Pair implements Comparable<Pair> {
5455
private final int x;
5556
private final int y;

0 commit comments

Comments
 (0)