包容羽毛

文章
7
资源
0
加入时间
4年1月24天

【面试题】二维数组中的查找(Java、Python实现)题目描述

题目描述解法一:暴力法时间复杂度:O(n*m),二维数组中的每个元素都被遍历一次,因此时间复杂度为二维数组的大小。空间复杂度:O(1)Pythonclass Solution(object): def findNumberIn2DArray(self, matrix, target): """ :type matrix: List[List[int]] :type target: int :rtype: