Leetcode - Search a 2D Matrix II (Python)

preview_player
Показать описание
February 2021 Leetcode Challenge
Leetcode - Search a 2D Matrix II #38
Difficulty: Medium
Рекомендации по теме
Комментарии
Автор

pretty amazing how simplicity can be so beautiful yet powerful, super clever approach.

felixreynoso
Автор

MY MIND IS This algo works on search 2d matrix 1 as well. In my understanding, it works as long as the columns are sorted, if not we would have to check if the target exists in the range of each row, then binary search through it to find it.

CEOofTheHood
Автор

Nice. I did it recursively using a binary search type thing, searching smaller matrices until result is found. Was more complicated but did get it done. Yours is simpler, glad a checked your channel

benpurcell
Автор

can I switch the order of the if statements? like I check if > then < then ==.

choliu
Автор

Could you please your thought when you first see this type of problem?

sauravdeb
Автор

can't believe it, it just abruptly ends and solved the problem

peilin
join shbcf.ru