Skip to content

Commit 4da0bfa

Browse files
committed
https://leetcode.cn/problems/rectangle-overlap/
1 parent 836bd0b commit 4da0bfa

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ leetcode 测试
1010

1111
##### 包含的内容如下
1212

13+
https://leetcode.cn/problems/rectangle-overlap/
14+
1315
https://leetcode.cn/problems/design-an-expression-tree-with-evaluate-function/
1416

1517
https://leetcode.cn/problems/find-positive-integer-solution-for-a-given-equation/

rectangle-overlap/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function isRectangleOverlap(
2+
rec1: number[],
3+
rec2: number[]
4+
): boolean {
5+
return (
6+
Math.min(rec1[2], rec2[2]) > Math.max(rec1[0], rec2[0]) &&
7+
Math.min(rec1[3], rec2[3]) > Math.max(rec1[1], rec2[1])
8+
);
9+
}

0 commit comments

Comments
 (0)