<doocs>1992.Find All Groups of Farmland_1.py
def findFarmland( land: List[List[int]]) -> List[List[int]]:
    m, n = len(land), len(land[0])
    ans = []
    for i in range(m):
        for j in range(n):
            if (
                land[i][j] == 0
                or (j > 0 and land[i][j - 1] == 1)
                or (i > 0 and land[i - 1][j] == 1)
            ):
                continue
            x, y = i, j
            while x + 1 < m and land[x + 1][j] == 1:
                x += 1
            while y + 1 < n and land[x][y + 1] == 1:
                y += 1
            ans.append([i, j, x, y])
    return ans
def sample_funcname ( var_0 : List [ List [ int ] ] ) -> List [ List [ int ] ] :
    var_4 , var_6 = len ( var_0 ) , len ( var_0 [ 0 ] )
    var_7 = [ ]
    for var_9 in range ( var_4 ) :
        for var_10 in range ( var_6 ) :
            if ( var_0 [ var_9 ] [ var_10 ] == 0 or ( var_10 > 0 and var_0 [ var_9 ] [ var_10 - 1 ] == 1 ) or ( var_9 > 0 and var_0 [ var_9 - 1 ] [ var_10 ] == 1 ) ) :
                continue
            var_12 , var_13 = var_9 , var_10
            while var_12 + 1 < var_4 and var_0 [ var_12 + 1 ] [ var_10 ] == 1 :
                var_12 += 1
            while var_13 + 1 < var_6 and var_0 [ var_12 ] [ var_13 + 1 ] == 1 :
                var_13 += 1
            var_7.append ( [ var_9 , var_10 , var_12 , var_13 ] )
    return var_7
