3 lines python solution


  • 0
    F
    class Solution(object):
    def searchMatrix(self, matrix, target):
        for i in xrange(len(matrix)):
            if i==len(matrix)-1: return target in matrix[i]
            elif matrix[i][0]<=target<matrix[i+1][0]: return target in matrix[i]

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.