#106
Number Maze
Difficulty: | Hard |
Topics: | numbers |
Given a pair of numbers, the start and end point,
find a path between the two using only three possible operations:
1. double
2. halve (odd numbers cannot be halved)
3. add 2
Find the shortest path through the “maze”.
Because there are multiple shortest paths,
you must return the length of the shortest path, not the path itself.
![]() | (= 1 (__ 1 1)) |
![]() | (= 3 (__ 3 12)) |
![]() | (= 3 (__ 12 3)) |
![]() | (= 3 (__ 5 9)) |
![]() | (= 9 (__ 9 2)) |
![]() | (= 5 (__ 9 12)) |