Leetcode - Search a 2D Matrix (Python)

preview_player
Показать описание
October 2020 Leetcode Challenge
Leetcode - Search a 2D Matrix # 74
Рекомендации по теме
Комментарии
Автор

Really like how you show the not so good version and slowly improves it to the better version :)

littleocean
Автор

bro you literally did 0 explanation of how it worked. just talked about it lol

EDROCKSWOO
Автор

you could also do

for row in range(M):
return binarysearch(row)

in the first solution, but that doesnt make much difference though lol

strandingstranger
Автор

I dont know if I should be asking this or not, but sir for the column part why did you take len(matrix[0]) and not len(matrix) .

tripathi
Автор

the second method doesn't work for the matrix = [[1, 4, 7], [2, 5, 8], [3, 6, 9]], target = 3

zihanwang
join shbcf.ru