| Action | Tickets Earned |
|---|---|
Complete Daily Challenge | +1 |
10-Day Streak | +10 |
20-Day Streak | +20 |
30-Day Streak | +30 |
LinkedIn post with #30DaysofCode Everyday (and tag Educative) | +2 per post |
Most-Liked Post Overall | +20 |
Top of Leaderboard | +50 |
Leaderboard: 2nd place | +30 |
Leaderboard: 3rd place | +20 |
You are given two integers n and k.
Initially, an array a of length n is initialized where a[i] = n.
Every second, the array is updated such that each element at index i is replaced by the sum of all elements from index i from the previous second.
Return the value of the element at index n k seconds.
Note: Since the answer can be large, return the result modulo
.
Constraints:
n, k
| Action | Tickets Earned |
|---|---|
Complete Daily Challenge | +1 |
10-Day Streak | +10 |
20-Day Streak | +20 |
30-Day Streak | +30 |
LinkedIn post with #30DaysofCode Everyday (and tag Educative) | +2 per post |
Most-Liked Post Overall | +20 |
Top of Leaderboard | +50 |
Leaderboard: 2nd place | +30 |
Leaderboard: 3rd place | +20 |
You are given two integers n and k.
Initially, an array a of length n is initialized where a[i] = n.
Every second, the array is updated such that each element at index i is replaced by the sum of all elements from index i from the previous second.
Return the value of the element at index n k seconds.
Note: Since the answer can be large, return the result modulo
.
Constraints:
n, k