What is the longest English word(s) that can be produced from the letters contained in each of the following?
(1) TWO THOUSAND AND TWELVE
(2) DUO MILIA ET MILLE
(3) DEUX MILLE ET DOUZE
(4) ZWEITAUSEND UND ZWOLF
(5) TO TUSINDE OG TOLV
(6) TWEEDUIZEND EN TWAALF
(7) TVA TUSEN OCH TOLV
(8) DOS MIL DOCE
(9) DUE MILA E DODICI
** For example, the longest word that can be produced from the letters contained in "NUHRIAKMTE" is "RUMINATE". For some of the above phrases, there may exist more than one word having the maximum number of letters.
*** Proper nouns, acronyms, abbreviations, hyphens, spaces are not allowed. Number of occurrences of a letter in the word is limited to the number of occurrences in the phrase.
Showing original letters, number used out of how many, fraction of letters used, and formed words:
original used/ fract. formed
letters out of used words
twothousandandtwelve 11/20 .5500 nonathletes
woodenheads
duomiliaetmille 10/15 .6667 multimedia
multimodal
deuxmilleetdouze 10/16 .6250 outduelled
zweitausendundzwolf 12/19 .6316 undefoliated
totusindeogtolv 12/15 .8000 deontologist
tweeduizendentwaalf 11/19 .5789 unalienated
tvatusenochtolv 10/15 .6667 convolutes
touchstone
dosmildoce 8/10 .8000 miscoded
duemilaedodici 10/14 .7143 duodecimal
DATA TWOTHOUSANDANDTWELVE
DATA DUOMILIAETMILLE
DATA DEUXMILLEETDOUZE
DATA ZWEITAUSENDUNDZWOLF
DATA TOTUSINDEOGTOLV
DATA TWEEDUIZENDENTWAALF
DATA TVATUSENOCHTOLV
DATA DOSMILDOCE
DATA DUEMILAEDODICI
CLS
DIM maxWord$(22)
FOR iter = 1 TO 9
READ source$
numWds = 0
source$ = LCASE$(source$)
maxSize = 0
OPEN "\words\words.txt" FOR INPUT AS #1
DO
LINE INPUT #1, w$
s$ = source$
good = 1
FOR i = 1 TO LEN(w$)
ix = INSTR(s$, MID$(w$, i, 1))
IF ix = 0 THEN good = 0: EXIT FOR
s$ = LEFT$(s$, ix - 1) + MID$(s$, ix + 1)
NEXT
IF good THEN
IF LEN(w$) >= maxSize THEN
IF LEN(w$) > maxSize THEN
maxSize = LEN(w$)
numWds = 1
ELSE
numWds = numWds + 1
END IF
maxWord$(numWds) = w$
END IF
END IF
LOOP UNTIL EOF(1)
CLOSE 1
PRINT source$; TAB(22); LTRIM$(STR$(maxSize)); "/"; LTRIM$(STR$(LEN(source$)));
PRINT TAB(28); : PRINT USING ".####"; maxSize / LEN(source$);
FOR i = 1 TO numWds
PRINT TAB(35); maxWord$(i)
NEXT
NEXT iter
|
Posted by Charlie
on 2012-05-02 13:27:09 |