Algorithm · Uber · Hard
Part 1 Given an integer n, imagine an n by n grid whose cells are labeled with integer coordinates $$(x, y)$$ from $$(0, 0)$$ to $$(n-1, n-1)$$. A piece starts at $$(0, 0)$$ and must reach $$(n-1, n-1)$$. For every ordered pair of positive integers $$(a, b)$$ with $$1 \le a < n$$ and $$1 \le b < n$$, the piece may move in one jump from $$(x, y)$$ to any cell reached by adding one of the eight vectors $$(\pm a, \pm b)$$ or $$(\pm b, \pm a)$$, provided that the resulting cell…
Checking your access…