All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > General > Word Problems
Another Couple 2 (Posted on 2023-08-20) Difficulty: 3 of 5
(Ia) Determine the longest common word/words with precisely four consonants in a row.
(Ib) Determine the shortest common word/words with precisely four consonants in a row.

(II) Extend (I) to cover the case of archaic/esoteric words.

*** No slangs, abbreviations/acronyms/proper names. Also, NO hyphenated words like X-ray, A-Bomb.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Some Thoughts different wordlist Comment 2 of 2 |
I get,
4 ['csch']  abbreviation for hyperbolic cosecant, so this does not count

5 ['angst', 'crwth', 'schmo', 'schwa']
   A crwth is a Welsh stringed musical instrument

17 ['anthracosilicosis', 'anthropogeography', 'anthropomorphosis', 'methylnaphthalene']

------------
The variable "words" is a list of about 47,000 words

w4inarow = [[] for i in range(50)]
consonants = 'bcdfghjklmnpqrstvwxz'
w4len = [0 for i in range(50)]
for w in words:
    concount = 0
    vowel = True
    for c in w:
        if vowel and c in consonants:
            concount = 1
            vowel = False
        elif not vowel and c in consonants:
            concount += 1
            vowel = False
        elif c not in consonants:
            concount = 0
            vowel = True
        if concount >= 4:
            w4inarow[len(w)].append(w)
            w4len[len(w)] += 1
            continue
for i in range(4,0,-1):
    if len(w4inarow[i]) > 0:
        print(i,w4inarow[i])
        break
for i in range(5,0,-1):
    if len(w4inarow[i]) > 0:
        print(i,w4inarow[i])
        break
for i in range(49,0,-1):
    if len(w4inarow[i]) > 0:
        print(i,w4inarow[i])
        break

  Posted by Larry on 2023-08-20 11:42:19
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (10)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information