Hello…
I am solving this question from hackerearth…
The logic i have applied is that first i have calculated the number of ways to go to k steps using atmost k steps…
Now after that… I have counted the number of steps to go till ‘X’ … Now this O(X) solution… as i have used prefix sum then also it is showing TLE…
How should i fix this…
This is my submission…
https://www.hackerearth.com/submission/51424329/
Please see this.
Thanks…