• + 0 comments

    Python 3 solution:

    return math.comb(n + k - 1, k) % 10 ** 9
    

    Explanation:

    See section Number of combinations with repetition here: https://en.wikipedia.org/wiki/Combination