Search in 2D Matrix
00:00
AmazonMicrosoft
Search for a target in an m×n matrix where each row is sorted and first integer of each row is greater than last of previous row.
Examples
Input → matrix=[[1,3,5,7],[10,11,16,20],[23,30,34,60]], target=3
Output → True
Input → same matrix, target=13
Output → False
Input → [[1]], target=1
Output → True