using System.Collections.Generic;
"bonjour", "coucou", "allo", "coucou", "yo", "bonjour", "coucou"
foreach(var (Mot, Nb) in CompterOccurrences(mots))
Console.WriteLine($"Le mot {Mot} apparaît {Nb} fois");
static (string Nom, int Nb)[] CompterOccurrences(string [] mots)
Dictionary<string, int> dictio = new ();
foreach(string mot in mots)
if(dictio.ContainsKey(mot))
(string, int) [] tab = new (string, int)[dictio.Count];
tab[i++] = (p.Key, p.Value);