Airbnb interview question

Matrix iterator