Find words which contains all the vowels: Difference between revisions
Find words which contains all the vowels (view source)
Revision as of 21:57, 10 August 2023
, 10 months ago→{{header|Haskell}}
Line 1,269:
or, adding the restriction to words of more than 10 characters, and using Data.Set to identify words with a set of 5 unique vowel characters, which have no more than 5 vowel characters in total:
<syntaxhighlight lang="haskell">import Data.
import Data.Set (Set, fromList, member, size)
---- WORDS OVER 10 CHARS WHICH CONTAIN EACH VOWEL ONCE ---
Line 1,278 ⟶ 1,279:
eachVowelOnce :: String -> Bool
eachVowelOnce w =
all (5 ==) $
vowels :: Set Char
|