Hudson River Trading interview question

Depth first search in a 2D array