Question: I am actually doing the `Daily Coding Problem #2`

I believe I have the result and I used it with recursion but I am wondering if it's good that I passed the `arr` in each recursion? Will passing it cause more memory or time?

The coding problem question is

> 
> Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i.
> 
> 
> For example, if our input was [1, 2, 3, 4, 5], the expected output
> would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the
> expected output would be [2, 3, 6]
> 
> 
> 

My code looks like

```
const multiply_without_index = (arr, index, result) => {
    result = result || [];
    index = index || 0;
    if(index === arr.length) return result;

    const copy_arr = [...arr];
    copy_arr.splice(index, 1);
    let total = 1;
    for(let n of copy_arr){
        total *= n;
    }
    result.push(total);
    index++;

    return multiply_without_index(arr, index, result);
}

```

Thanks in advance for any advices.

Answer: 
Are you probably using Composer v2? When I use the given JSON in my local environment using Composer v1, it tells me:

> 
> Deprecation warning: Your package name vendor\_name/PhpProjec is invalid, it should not contain uppercase characters. We suggest using vendor\_name/php-projec instead. Make sure you fix this as Composer 2.0 will error.
> 
> 
> 

The error message you've provided does not occur on my system. If you are still facing problems after using another package name, please share more details
composer is case sensitive from v1.9 onwards...
so change "PhpProject" to "phpproject"

```
   {
  "name": "vendor_name/phpproject",
  "description": "description",
  "minimum-stability": "stable",
  "license": "proprietary",
  "authors": [
    {
      "name": "***",
      "email": "email@example.com"
    }
  ],
  "require": {
    "barryvdh/laravel-ide-helper": "v2.7.0"
  }

```