Amazon Interview Question

Flood filling in 2-D matrix