question link:https://hack.codingblocks.com/contests/c/547/1045
- What is the best way to %(10^9+7). You can see how I have done it in the code. But I do think my code is not an efficient one. Do comment how can I make it more efficient. Also, is there any Top-to-Bottom approach to this question.
Code link with DP www.ideone.com/FVyWUd