836. Rectangle Overlap

Posted gopanama

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了836. Rectangle Overlap相关的知识,希望对你有一定的参考价值。

 1 class Solution {
 2     public boolean isRectangleOverlap(int[] rec1, int[] rec2) {
 3         if((rec2[0]<=rec1[0] && rec2[2]<=rec1[0]) || (rec2[0]>=rec1[2] && rec2[2]>=rec1[2])) {
 4             return false;
 5         }else {
 6             if((rec2[1]<=rec1[1] && rec2[3]<=rec1[1]) || (rec2[1]>=rec1[3] && rec2[3]>=rec1[3])) {
 7                 return false;
 8             }
 9         }
10         return true;
11         
12     }
13 }

 

以上是关于836. Rectangle Overlap的主要内容,如果未能解决你的问题,请参考以下文章

836. Rectangle Overlap

leetcode 836. Rectangle Overlap

836. Rectangle Overlap 矩形重叠

836. Rectangle Overlap

836. Rectangle Overlap ——weekly contest 85

[LeetCode&Python] Problem 836. Rectangle Overlap