问题:
You are given a two-dimensional array (matrix) of distinct integers where each row is sorted and each column is also sorted. The matrix does not necessarily have the same height and width. You are also given a target number, and you must write a function that returns an array of the row and column indices of the target number if it is contained in the matrix and [-1, -1] if it is not contained in the matrix.
题目大致意识是,给定一个有序的二维矩阵,然后给定一个目标值,想从这个有序矩阵中,找到这个目标值,如果没有找到的话,返回False, 找到返回True。
该有序的二维矩阵,从左到右行有序,从上到下列有序:
以上图为例,假设taget num是44,矩阵中的位置是第3行第3列