You start with an integer target.
In a single move, you can perform one of the following actions:
Increment the current number by
Multiply the current number by
You can perform the multiplication action at most maxDoubles times. There is no limit on the number of increment actions.
Return the minimum number of moves needed to reach target starting from
Constraints:
target
maxDoubles
You start with an integer target.
In a single move, you can perform one of the following actions:
Increment the current number by
Multiply the current number by
You can perform the multiplication action at most maxDoubles times. There is no limit on the number of increment actions.
Return the minimum number of moves needed to reach target starting from
Constraints:
target
maxDoubles