Demo entry 5865406



Submitted by anonymous on Aug 24, 2016 at 05:20
Language: Python. Code size: 461 Bytes.

class Solution(object):
    def searchMatrix(self, matrix, target):
        :type matrix: List[List[int]]
        :type target: int
        :rtype: bool
        if not len(matrix) or not len(matrix[0]): return False
        while(n<c and m>=0):
            if matrix[n][m]>target: m-=1
            elif matrix[n][m]<target: n+=1
            else: return True
        return False

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).