<p>Given a function <code>fn</code>, return a <strong>memoized</strong> version of that function.</p>
<p>A <strong>memoized </strong>function is a function that will never be called twice with the same inputs. Instead it will return a cached value.</p>
<p>You can assume there are <strong>3 </strong>possible input functions: <code>sum</code><strong>, </strong><code>fib</code><strong>, </strong>and <code>factorial</code><strong>.</strong></p>
<ul>
<li><code>sum</code><strong> </strong>accepts two integers <code>a</code> and <code>b</code> and returns <code>a + b</code>. Assume that if a value has already been cached for the arguments <code>(b, a)</code> where <code>a != b</code>, it cannot be used for the arguments <code>(a, b)</code>. For example, if the arguments are <code>(3, 2)</code> and <code>(2, 3)</code>, two separate calls should be made.</li>
<li><code>factorial</code> accepts a single integer <code>n</code> and returns <code>1</code> if <code>n <= 1</code> or <code>factorial(n - 1) * n</code> otherwise.</li>