# leetcode240.搜索二维矩阵II

```golang
func searchMatrix(matrix [][]int, target int) bool {
    i,j:=0,len(matrix[0])-1
    m,_:=len(matrix),len(matrix[0])

    for i<m && j>=0{
        if matrix[i][j]==target{
            return true
        }

        if  matrix[i][j]>target{
            j--
        }else{
            i++
        }
            
    }
    return false
    
}
```
