Leetcode 836. Rectangle Overlap Python

preview_player
Показать описание
Full version of this LeetCode solution available on my Udemy course (100 LeetCode videos):
Рекомендации по теме
Комментарии
Автор

your code can't pass this data :
[-1, 0, 1, 1]
[0, -1, 0, 1]

lizhao
Автор

add this corner case will resolve the issue
if rec1[0]==rec1[2] or rec1[1]==rec1[3] or rec2[0]==rec2[2] or rec2[1]==rec2[3]:
return False

lizhao