Find shortest path on infinite grid | ZipHQ Interview Question