题解 | #矩阵元素查找#
矩阵元素查找
http://www.nowcoder.com/practice/3afe6fabdb2c46ed98f06cfd9a20f2ce
查找矩阵的元素,返回的是元素的下标,【1,2】下标的是6,从0开始算的下标。
class Solution: def findElement(self, mat, n, m, x): # write code here for i in range(n): for j in range(m): # print(mat[i][j])// if mat[i][j] == x: return [i,j]//不能新建ans=[],不能返回ans.append,原因还在找 return None