Adobe Interview Question

A not-so-basic question on solving a problem using a (flood-fill) algorithm.