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 ...
随机推荐
- HDU-1004.Let the ballon Rise(STL-map)
2019-02-28-08:56:03 初次做本题是用字符串硬钢,最近校队训练时又遇到才知道用map是真的舒服.需要注意的是map的用法. clear : 清除map中的所有元素,map.clear( ...
- JSON Extractor
JMeter处理responses 的json 对于请求1返回的结果,处理以后作为请求2的参数,JMeter提供了JSON 提取器 比如 responses 返回: {"statusCode ...
- @RequestBody使用须知
-----------------------siwuxie095 @RequestBody 使用须知 使用 @Requ ...
- css控制div上浮下落
CSS3 示例:http://www.w3school.com.cn/cssref/pr_keyframes.asp 以下是代码: <!DOCTYPE html> <html> ...
- mysql-5.7.21安装和配置方法
到MySQL官网下载MySQL 5.7.21的版本,下载地址:https://dev.mysql.com/downloads/mysql/ .根据自己的系统下载相应的32位或64位的版本. 将下载 ...
- linux查看本服务端口开放情况
在Linux使用过程中,需要了解当前系统开放了哪些端口,并且要查看开放这些端口的具体进程和用户,可以通过netstat命令进行简单查询. 1.netstat命令各个参数说明如下: -t : 指明显示T ...
- AndroidManifest中注册application
<application android:icon="@drawable/icon1" android:label="@string/app_name" ...
- 编码补充 daty 6
---恢复内容开始--- 1. 用id求内存地址 id 查询内存地址 name = 'alex' print(id(name)) li = [1,2,3] print(id(li)) 结果: 2. ...
- SQL新增数据取表主键最新值
string strsql = "insert into SB_Survey(title) values ('标题');select @@IDENTITY"; int s = in ...
- Vue 插件和Preset
插件和Preset 插件 Vue CLI 使用了一套基于插件的架构 Vue CLI 使用了一套基于插件的架构.如果你查阅一个新创建项目的 package.json,就会发现依赖都是以 @vue/cli ...