Reach a Number
You are standing at position 0 on a number line. You want to reach a positive target position target.
You can move in either the left or right direction. When you move in the left direction, you subtract from your current position, and when you move in the right direction, you add to your current position. Return the minimum number of moves required to reach the target position.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)