parameters: (arr, i, j, n, m)
docstring: bfs 标记
docstring_summary: bfs 标记
docstring_tokens: bfs 标记
function: def b_inject(arr, i, j, n, m):
      """bfs 标记"""
      tmp = [[i,j]]
      while len(tmp)>0:
          i, j = tmp.pop()
          arr[i][j] = 2
          if i >= n or j >= m:
              break
          if i<n-1 and arr[i+1][j] == 1:
              tmp.append([i+1, j])
          if i>0 and arr[i-1][j] == 1:
              tmp.append([i-1, j])
          if j<m-1 and arr[i][j+1] == 1:
              tmp.append([i, j+1])
          if j>0 and arr[i][j-1] == 1:
              tmp.append([i, j-1])
function_tokens: def b_inject ( arr , i , j , n , m ) : tmp = [ [ i , j ] ] while len ( tmp ) > 0 : i , j = tmp . pop ( ) arr [ i ] [ j ] = 2 if i >= n or j >= m : break if i < n - 1 and arr [ i + 1 ] [ j ] == 1 : tmp . append ( [ i + 1 , j ] ) if i > 0 and arr [ i - 1 ] [ j ] == 1 : tmp . append ( [ i - 1 , j ] ) if j < m - 1 and arr [ i ] [ j + 1 ] == 1 : tmp . append ( [ i , j + 1 ] ) if j > 0 and arr [ i ] [ j - 1 ] == 1 : tmp . append ( [ i , j - 1 ] )