LeetCode 836: Rectangle Overlap - Interview Prep Ep 44

preview_player
Показать описание


⭐ Support my channel and connect with me:

Solution explained:
1. we could try to first figure out how two segments could overlap in a one dimensional world;
2. then based on the conditions we get from #1, we simply extend them to a two dimensional world.

// TOOLS THAT I USE:

// MY FAVORITE BOOKS:

My ENTIRE Programming Equipment and Computer Science Bookshelf:

And make sure you subscribe to my channel!

Your comments/thoughts/questions/advice will be greatly appreciated!

#softwareengineering #leetcode #algorithms #coding #interview #SDE #SWE #SiliconValley #programming #datastructures
Рекомендации по теме
Комментарии
Автор

Thands
This is very helpful for me👍👍👍

sadeghkhosravi
Автор

Super cool. I was able to understand from your video very well

rajatgarg
Автор

Sir in my case it is showing error because of positive intersection

guyswapnil
Автор

Sadly doesn't work for python, even if I copied and pasted the solution. So sad today:

class Solution(object):
def isRectangleOverlap(self, rec1, rec2):
"""
:type rec1: List[int]
:type rec2: List[int]
:rtype: bool
"""
return rec1[0] < rec2[2] and rec2[0] < rec1[2] and rec1[1] < rec2[3] and rec2[1] < rec1[3]

edwardteach
Автор

Can you please solve these solutions in Python as very less Python explanations on YouTube.

neerajbh