Find shortest path on infinite grid | ZipHQ Coding Question