3 ms·
So the optimization here is that instead of creating a new array every time you call the count function recursively, you're only modifying a single array. Thus
by 65 3y ago
So the optimization here is that instead of creating a new array every time you call the count function recursively, you're only modifying a single array. Thus the new array recursive function is significantly slower because we're storing all those arrays in memory when calling the count function recursively. Do I have that right?