Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • The whole modulo thing makes me think there could be some kind of mathematical hackery to turn it into simple equation. Commented Sep 4, 2014 at 6:54
  • yes I also think big number multiplication take more time Commented Sep 4, 2014 at 6:55
  • Shouldn't the modulo also be in calculateProduction for each variable? The way you have it now seems to be incorrect. Commented Sep 4, 2014 at 7:00
  • First I have thought recursive solution with dynamic programming but it take more time Hang on... It shouldn't. Post the dynamic programming version. Commented Sep 4, 2014 at 7:37
  • sure I will update my post .. Commented Sep 4, 2014 at 7:45