240. Search a 2D Matrix II
# Medium
Last updated
Was this helpful?
# Medium
Last updated
Was this helpful?
find the fisrt position in a row bigger than target, then throw corresponded columns
consider edge case
matrix is
m
rows andn
columns,m * n
check from first to last row, find the first position in a row bigger than target, then throw one row or a few columns with one row
do search insertion position in each row
check from right top or left bottom element, every time throw one column or row
time complexity:
Time complexity: