DEV Community

Discussion on: Dynamic Programming Series - Introduction

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

You left in the #define MOD 1000000007 and % MOD which isn't part of the explanation. Though I recall see computing tests that have this requirement on them. :)

Collapse
 
ankursheel profile image
Ankur Sheel • Edited

I do mention the reason in the Top-Down Recursive approach with Memoization section. Re-iterating it here for your convenience We mod the result using 1000000007 to avoid overflows.