{"ScriptPreparationCode":"var n = 8;","TestCases":[{"Name":"Using Go Bottom Up","Code":"function getNthNumber() {\r\n let prev = 0;\r\n let afterPrev = 1;\r\n let current = 1;\r\n \r\n for(let i = 1; i \u003C= n; i\u002B\u002B) {\r\n current = prev \u002B afterPrev\r\n afterPrev = prev\r\n prev = current\r\n }\r\n return current\r\n}\r\n\r\ngetNthNumber()","IsDeferred":false},{"Name":"Using Memoization","Code":"function getNthNumber() {\r\n const memoize = [];\r\n \r\n const cb = (n) =\u003E {\r\n if(n \u003C= 2 ) return 1;\r\n if(memoize[n]) return memoize[n];\r\n \r\n memoize[n] = cb(n - 1) \u002B cb(n - 2);\r\n return memoize[n];\r\n }\r\n return cb(n)\r\n}\r\n\r\ngetNthNumber()","IsDeferred":false}]}