# Untitled

unknown

plain_text

6 months ago

616 B

3

Indexable

Never

^{}

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