本文整理汇总了Python中solution.Solution.searchMatrix方法的典型用法代码示例。如果您正苦于以下问题:Python Solution.searchMatrix方法的具体用法?Python Solution.searchMatrix怎么用?Python Solution.searchMatrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类solution.Solution
的用法示例。
在下文中一共展示了Solution.searchMatrix方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test4
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import searchMatrix [as 别名]
def test4(self):
s = Solution()
matrix = [
[1],
]
target = 1
res = s.searchMatrix(matrix, target)
print res
示例2: test3
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import searchMatrix [as 别名]
def test3(self):
s = Solution()
matrix = [
[1, 3],
]
target = 3
res = s.searchMatrix(matrix, target)
print res
示例3: test1
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import searchMatrix [as 别名]
def test1(self):
s = Solution()
matrix = [
[1, 3, 5, 7],
[10, 11, 16, 20],
[23, 30, 34, 50]
]
target = 3
res = s.searchMatrix(matrix, target)
print res
示例4: Solution
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import searchMatrix [as 别名]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from solution import Solution
m = [[1, 4, 7, 11, 15],
[2, 5, 8, 12, 19],
[3, 6, 9, 16, 22],
[10, 13, 14, 17, 24],
[18, 21, 23, 26, 30]]
t = 2
sol = Solution()
res = sol.searchMatrix(m, t)
print(res)
示例5: test
# 需要导入模块: from solution import Solution [as 别名]
# 或者: from solution.Solution import searchMatrix [as 别名]
def test(self):
matrix = [[1, 3]]
target = 3
s = Solution()
rtn = s.searchMatrix(matrix, target)
self.assertEqual(rtn, True)