Added parameter to pass memory as array in memoized for of fibonacci