From 25669da340a5426231613b136092b12af46c292c Mon Sep 17 00:00:00 2001 From: Antoine Van Elstraete Date: Tue, 25 Jan 2022 11:41:57 +0100 Subject: [PATCH] Optimisation de "noDouble()" --- wgamesolv.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/wgamesolv.py b/wgamesolv.py index f894d70..23cdf84 100755 --- a/wgamesolv.py +++ b/wgamesolv.py @@ -20,13 +20,9 @@ def noDouble(mots): # Fonction d'élimination de mots contenant plusieurs occurences de lettres ndList = [] for mot in mots: - llist = [] - for lettre in mot: - if lettre not in llist: - llist.append(lettre) - if len(mot) == len(llist): + if len(list(mot)) == len(set(list(mot))): ndList.append(mot) - return(ndList) + return ndList def firstTryFilter(mots, max_mots):