Amazon interview question

Implement a variation of the flood fill algorithm