It mainly finds the previous color on ( x , y ) and calls floodFillUtil ( )
void floodFill ( int screen [ ] [ N ] , int x , int y , int newC ) { int prevC = screen [ x ] [ y ] ; floodFillUtil ( screen , x , y , prevC , newC ) ; }