<p>Given an array of asynchronous functions <code>functions</code>, return a new promise <code>promise</code>. Each function in the array accepts no arguments and returns a promise. All the promises should be executed in parallel.</p>
<li>When all the promises returned from <code>functions</code> were resolved successfully in parallel. The resolved value of <code>promise</code> should be an array of all the resolved values of promises in the same order as they were in the <code>functions</code>. The <code>promise</code> should resolve when all the asynchronous functions in the array have completed execution in parallel.</li>
<li>When any of the promises returned from <code>functions</code> were rejected. <code>promise</code> should also reject with the reason of the first rejection.</li>
</ul>
<p>Please solve it without using the built-in <code>Promise.all</code> function.</p>
<p> </p>
<p><strongclass="example">Example 1:</strong></p>
<pre>
<strong>Input:</strong> functions = [
() => new Promise(resolve => setTimeout(() => resolve(5), 200))