836. Rectangle Overlap
class Solution
{
public:
bool isRectangleOverlap(vector<int>& rec1, vector<int>& rec2)
{
return rec1[]<rec2[]&&rec2[]<rec1[]&&rec1[]<rec2[]&&rec2[]<rec1[];
}
};
r1left r2left r1right r2right
一个方向上的判定条件:left1<right2&&left2<right1
用两个方向上的判定即可
836. Rectangle Overlap的更多相关文章
- 【Leetcode_easy】836. Rectangle Overlap
problem 836. Rectangle Overlap solution: class Solution { public: bool isRectangleOverlap(vector< ...
- 836. Rectangle Overlap ——weekly contest 85
Rectangle Overlap A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coor ...
- #Leetcode# 836. Rectangle Overlap
https://leetcode.com/problems/rectangle-overlap/ A rectangle is represented as a list [x1, y1, x2, y ...
- [LeetCode&Python] Problem 836. Rectangle Overlap
A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of its bot ...
- 836. Rectangle Overlap 矩形重叠
[抄题]: A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of i ...
- 【LeetCode】836. Rectangle Overlap 解题报告(Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/rectangle ...
- [LeetCode] Rectangle Overlap 矩形重叠
A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of its bot ...
- [Swift]LeetCode836. 矩形重叠 | Rectangle Overlap
A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of its bot ...
- LeetCode - Rectangle Overlap
A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of its bot ...
随机推荐
- Python os.sep()
os.sep是什么 python是跨平台的.在Windows上,文件的路径分隔符是'\',在Linux上是'/'. 为了让代码在不同的平台上都能运行,那么路径应该写'\'还是'/'呢? 使用os.se ...
- 上海高校金马五校赛 F题:1 + 2 = 3?
链接:https://www.nowcoder.com/acm/contest/91/F来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 131072K,其他语言26214 ...
- 【Linux 进程】fork函数详解
一.fork入门知识 一个进程,包括代码.数据和分配给进程的资源.fork()函数通过系统调用创建一个与原来进程几乎完全相同的进程,也就是两个进程可以做完全相同的事,但如果初始参数或者传入的变量不同, ...
- RabbitMQ 参数们的Power “续”
参数中的 arguments 之前讲参数的一些作用的时候,忽略了最后一个字典类型的参数,因为这个参数是大有文章的,值得单独进出来说道说道. 这时,就不得不打开我们的 Web UI管理系统了,可以看 ...
- iOS 证书申请新步骤
2018iOS完整的证书申请和打包过程 - 简书https://www.jianshu.com/p/2b3c2693f4f2
- SQL SERVER数据库性能优化之SQL语句篇
(引用自重明鸟的博客,方便学习和查看) 1. 按需索取字段,跟“SELECT *”说拜拜 字段的提取一定要按照“用多少提多少”的原则,避免使用“SELECT *”这样的操作.做了这样一个实验,表tbl ...
- 弹框alertView
// 创建一个弹框UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@“标题” message:@“显示的具体内容” delegate:s ...
- 梦殇 chapter three
chapter three 悲伤有N个层面.对于生命是孤独的底色,对于时间是流动的伤感,对于浪漫是起伏的变奏,对于善和怜悯是终生的慨叹…… 出去和舍友买完东西,刚回到宿舍,舍友就说,刚才有人给你打电话 ...
- 【转】我为什么把think in java 读了10遍
我在想写这篇博文之前,就曾经对我媳妇(她是做web前端的)讲,我把think in java看了几次几次,媳妇那时就用很羡慕和莫名的眼神看着我说,你真有毅力,我当时就蒙了,我以为她会说,你现在基础一定 ...
- spec文件写作规范
spec文件写作规范 2008-09-28 11:52:17 分类: LINUX 1.The RPM system assumes five RPM directories BUILD:rpmbuil ...