diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2019-04-28 17:05:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-28 17:05:26 +0100 |
| commit | c7232efc6a894a31ce8955a8eaaac7c5fde3147b (patch) | |
| tree | 35bbbe9383ae177c9e1edcf2f9f00d43d2324db1 /challenge-005/jaime/README | |
| parent | 9d59574e8be350125b0da3b472211f214dc16002 (diff) | |
| parent | f11380b812efb07439d9038a7debecccaf8f1f95 (diff) | |
| download | perlweeklychallenge-club-c7232efc6a894a31ce8955a8eaaac7c5fde3147b.tar.gz perlweeklychallenge-club-c7232efc6a894a31ce8955a8eaaac7c5fde3147b.tar.bz2 perlweeklychallenge-club-c7232efc6a894a31ce8955a8eaaac7c5fde3147b.zip | |
Merge pull request #102 from bracteatus/master
Solutions to 005 with built-in English dictionary.
Diffstat (limited to 'challenge-005/jaime/README')
| -rw-r--r-- | challenge-005/jaime/README | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/challenge-005/jaime/README b/challenge-005/jaime/README index 5b29651691..46e62dafa4 100644 --- a/challenge-005/jaime/README +++ b/challenge-005/jaime/README @@ -1 +1,23 @@ -Solution by Jaime Corchado. +Solution by Jaime Corchado, (@tortsnare)[https://twitter.com/tortsnare]. + +#Challenge #1 +Write a program which prints out all anagrams for a given word. + +## Solution +Lookup anagrams in a hash of Engligh words. + +The script does initialize a list of words from Webster's Second International dictionary, + but I removed any hyphenated or capitalized words. + +All words are keyed by alphabetical order. `join "", sort split //` +Words that are anagrams of one another share the same key. +Words that are not anagrams, do not share a key. + +The script reports the anagrams of its arguments by looking up all words that share the key. + +#Challenge #2 +Write a program to find the sequence of characters that has the most. + +## Solution +The English words are hashed as before. +The script tracks the key with the most additions. |
