Problem with ArrayList and remove Gameobject C#

Hello!
So I am trying to make a Hack and Slash and I am running in to a problem with my enemies. I create them within an arraylist but when I come to kill one, my player hits it and then I get the following error : InvalidOperationException: List has changed. Haven’t had much chance finding any solutions.
Thanks.

enter code here 

public class PlayerAttack : MonoBehaviour
{
public int minimumDistance = 2;
public static ArrayList allennemys;

void Start()
{
 	allennemys = new ArrayList( GameObject.FindGameObjectsWithTag("Ennemy") );
}

void Update ()
{
	foreach(GameObject go in allennemys)
	{
		if(Input.GetMouseButtonDown(0))
		{
			if(Vector3.Distance(transform.position, go.transform.position) < minimumDistance)
			{
				Debug.Log("Bitch Please!");
				allennemys.Remove(go);
				
			}
		}
	}
}

}

Yeah that’s a fun one - a foreach can’t iterate a list that changes - it breaks the enumerator.

Add:

var deleteEnemies : ArrayList = new ArrayList();

Just before the foreach. Then rather than

 allennemys.Remove(go);

Do

 deleteEnemies.Add(go);

And after the end of the foreach do another one like this:

foreach(var e in deleteEnemies)
{
    allennemys.Remove(e);
}

If you want a less verbose way - you can just make a copy of the allennemys list using Linq.

using System.Linq;

....

foreach(GameObject fo in allennemys.ToList())
{
...
}

Thanks for your answer =)