leetcode836
public class Solution
{
public bool IsRectangleOverlap(int[] rec1, int[] rec2)
{
return Math.Max(rec1[], rec2[]) < Math.Min(rec1[], rec2[])
&&
Math.Max(rec1[], rec2[]) < Math.Min(rec1[], rec2[]);
}
}
这种几何图形问题,参考网上的答案。
leetcode836的更多相关文章
- [Swift]LeetCode836. 矩形重叠 | Rectangle Overlap
A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of its bot ...
- Leetcode836.Rectangle Overlap矩阵重叠
矩形以列表 [x1, y1, x2, y2] 的形式表示,其中 (x1, y1) 为左下角的坐标,(x2, y2) 是右上角的坐标. 如果相交的面积为正,则称两矩形重叠.需要明确的是,只在角或边接触的 ...
随机推荐
- MySQL的用户账户管理
1.开启MySQL远程连接 1.sudo -i 2.cd /etc/mysql/mysql.conf.d/ 3.vim mysqld.cnf #bind-address = 127.0.0.1 把前面 ...
- 使用python处理selenium中的css_selector定位元素的模糊匹配问题
# 匹配id,先指定一个html标签,然后加上“#”符号,再加上id的属性值 self.driver.find_element_by_css_selector('div#ID').click() # ...
- webdriver元素定位
#1 通过id定位 driver.find_element_by_id("pop_setting_save").click() #2 通过name定位 driver.find_el ...
- Windows下Redis的使用
Redis介绍 Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,和Memcached类似,它支持存储的value类型相对更多,包括st ...
- [LeetCode系列]括号生成问题
给定n, 返回所有匹配的n对括号的可能形式. 如 给定 n = 3, 一个解集是: "((()))", "(()())", "(())()" ...
- strlen和sizeof的长度区别
strlen返回字符长度 而sizeof返回整个数组占多长,字符串的\0也会计入一个长度
- bzoj 1670 [Usaco2006 Oct]Building the Moat护城河的挖掘——凸包
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1670 用叉积判断.注意两端的平行于 y 轴的. #include<cstdio> ...
- (转)Android自定义属性时format选项( <attr format="reference" name="background" /> )
Android自定义属性时format选项可以取用的值 1. reference:参考某一资源ID. (1)属性定义: [html] view plaincopyprint? <declar ...
- 搭建一个免费的,无限流量的Blog----github Pages和Jekyll入门(转)
转自:http://www.ruanyifeng.com/blog/2012/08/blogging_with_jekyll.html 喜欢写Blog的人,会经历三个阶段. 第一阶段,刚接触Blog, ...
- Linux proc_mkdir和proc_create的用法
//功能:在proc中创建一个文件夹 //参数1:创建的文件夹名称 //参数2:创建的文件夹路径,就是在哪个文件夹中创建,如果是proc根目录,此参数为NULL //返回值:创建的文件夹路径 stru ...