Help needed in optimising the memoized solution!!!

Revision en5, by Vesper_Lynd, 2018-08-18 18:10:37

why memoized solution fails in this problem: Source //below is the given code

//can you help me spot some patterns to optimise it!!!

my code:

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English Vesper_Lynd 2018-08-18 18:10:37 860
en4 English Vesper_Lynd 2018-08-18 16:54:47 28
en3 English Vesper_Lynd 2018-08-18 16:54:04 14
en2 English Vesper_Lynd 2018-08-18 16:53:04 14
en1 English Vesper_Lynd 2018-08-18 16:51:48 1181 Initial revision (published)