Added Memoized version of goldmines problem