original_docstring: 
          Do not return anything, modify rooms in-place instead.
          
docstring: Do not return anything, modify rooms in-place instead.
docstring_tokens: Do not return anything modify rooms in - place instead .
code: def wallsAndGates(self, rooms: List[List[int]]) -> None:
          """
          Do not return anything, modify rooms in-place instead.
          """
          if not rooms:
              return
          m, n = len(rooms), len(rooms[0])
          stack = []
          for i in range(m):
              for j in range(n):
                  if rooms[i][j] == 0:
                      stack.append((i,j))
          dirs = [(0,1), (0,-1), (1,0), (-1,0)]
          while stack:
              x, y = stack.pop()
              for dx, dy in dirs:
                  nx = dx + x
                  ny = dy + y
                  if 0<=nx<m and 0<=ny<n and rooms[nx][ny]!=-1 and rooms[x][y] + 1 < rooms[nx][ny]:
                      rooms[nx][ny] = rooms[x][y] + 1
                      stack.append((nx,ny))
code_tokens: def wallsAndGates ( self , rooms : List [ List [ int ] ] ) -> None : if not rooms : return m , n = len ( rooms ) , len ( rooms [ 0 ] ) stack = [ ] for i in range ( m ) : for j in range ( n ) : if rooms [ i ] [ j ] == 0 : stack . append ( ( i , j ) ) dirs = [ ( 0 , 1 ) , ( 0 , - 1 ) , ( 1 , 0 ) , ( - 1 , 0 ) ] while stack : x , y = stack . pop ( ) for dx , dy in dirs : nx = dx + x ny = dy + y if 0 <= nx < m and 0 <= ny < n and rooms [ nx ] [ ny ] != - 1 and rooms [ x ] [ y ] + 1 < rooms [ nx ] [ ny ] : rooms [ nx ] [ ny ] = rooms [ x ] [ y ] + 1 stack . append ( ( nx , ny ) )
short_docstring: Do not return anything, modify rooms in-place instead.
short_docstring_tokens: Do not return anything modify rooms in - place instead .
comment: """
          Do not return anything, modify rooms in-place instead.
          """