Optimize function

 

 

Rewrite the function for it to have O(n) time complexity. Add explanations (±300 words)

const n = 1000;

const array1 = [];
const array2 = [];

for(let i=0;i

find the cost of your paper

This question has been answered.

Get Answer