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 int TrouverIndice(List<(string Mot, int Nb)> mots, string mot)
for(int i = 0; i != mots.Count; ++i)
static (string Nom, int Nb)[] CompterOccurrences(string [] mots)
List <(string Mot, int Nb)> lst = new ();
foreach(string mot in mots)
int ndx = TrouverIndice(lst, mot);
lst[ndx] = (mot, lst[ndx].Nb + 1);