Urban Company interview question

Reasoning