Coding Interview Question - Overlapping Rectangles

preview_player
Показать описание
A quicker/shorter version of my previous video! I hope you like.
Рекомендации по теме
Комментарии
Автор

Amazing video, I've been stuck at this one for a while

eduardofigueiredofreireand
Автор

Excellent! You helped me solve one of my exercises in python! (learned Java a bit so understood your codes) Many thanks!

nadekang
Автор

I have a question! 4 days spent trying to understand overlapping I'm trying to check rectangles already drawn before another can be drawn with a for loop. Should I draw a fake rectangle at location x and y before drawing then check over lapse? Just popped in my head after watching this

droidlycodes
Автор

overlapX = max(a.x, b.x). overlapWidth = min(a.x + a.width, b.x + b.width): if (overlapWidth <= 0) return null; same for Y

vadimkokielov
Автор

I can not understand. If I've git bigger Y of firstRectangle, then upperRectangle = firstRectangle. You've got opposite. Why?

Mustcikjanik
Автор

Very well explained and presented! Your approach was simple and precise. :)

krishprasadar
Автор

is it necessary take the inverted y-axis?

srishtibadola