We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
We can compose the problem as an algebraic expression: x1 + (j * v1) = x2 + (j * v2) where j is the number of jumps. The result line below is reducing the above formula to solve for j. For j to be valid in our problem, it has to be a positive whole number which we check within our if statement.
Number Line Jumps
You are viewing a single comment's thread. Return to all comments →
Typescript solution:
We can compose the problem as an algebraic expression: x1 + (j * v1) = x2 + (j * v2) where j is the number of jumps. The result line below is reducing the above formula to solve for j. For j to be valid in our problem, it has to be a positive whole number which we check within our if statement.