Skip to content

Commit 84ba948

Browse files
add skeleton for 836
1 parent 972907f commit 84ba948

File tree

1 file changed

+30
-0
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.fishercoder.solutions;
2+
3+
/**
4+
* 836. Rectangle Overlap
5+
*
6+
* A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of
7+
* its bottom-left corner, and (x2, y2) are the coordinates of its top-right corner.
8+
* Two rectangles overlap if the area of their intersection is positive.
9+
* To be clear, two rectangles that only touch at the corner or edges do not overlap.
10+
* Given two (axis-aligned) rectangles, return whether they overlap.
11+
*
12+
* Example 1:
13+
* Input: rec1 = [0,0,2,2], rec2 = [1,1,3,3]
14+
* Output: true
15+
*
16+
* Example 2:
17+
* Input: rec1 = [0,0,1,1], rec2 = [1,0,2,1]
18+
* Output: false
19+
*
20+
* Notes:
21+
* Both rectangles rec1 and rec2 are lists of 4 integers.
22+
* All coordinates in rectangles will be between -10^9 and 10^9.
23+
* */
24+
public class _836 {
25+
public static class Solution1 {
26+
public boolean isRectangleOverlap(int[] rec1, int[] rec2) {
27+
return false;
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)