Untitled
unknown
plain_text
a year ago
616 B
8
Indexable
You are given two positive integers startPos and endPos. Initially, you are standing at position startPos on an infinite number line. With one step, you can move either one position to the left, or one position to the right. Given a positive integer k, return the number of different ways to reach the position endPos starting from startPos, such that you perform exactly k steps. Since the answer may be very large, return it modulo 10^9 + 7. Two ways are considered different if the order of the steps made is not exactly the same. Note that the number line includes negative integers please code in java
Editor is loading...