It mainly finds the previous color on ( x , y ) and calls floodFillUtil ( )
def floodFill ( screen , x , y , newC ) : NEW_LINE INDENT prevC = screen [ x ] [ y ] NEW_LINE floodFillUtil ( screen , x , y , prevC , newC ) NEW_LINE DEDENT