Ways to Reach After K Steps
On an infinite number line, count distinct sequences of ±1 moves that reach a target position in exactly k steps. The answer is C(k, (k + d)/2) where d is the distance, if (k-d) is non-negative and even.
On an infinite number line, count distinct sequences of ±1 moves that reach a target position in exactly k steps. The answer is C(k, (k + d)/2) where d is the distance, if (k-d) is non-negative and even.