diff options
| author | drclaw1394 <drclaw@mac.com> | 2019-06-10 20:56:34 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-10 20:56:34 +1000 |
| commit | 5c1663e3f7a4bf8767cd62c4e7db03186561edb2 (patch) | |
| tree | 2a0fa3af0f3b0fd5a71a9ae67984f4fa2adb8aa1 /challenge-012/jaime | |
| parent | b577c5e4a0a63be26d335cb74580c1ae721105c0 (diff) | |
| parent | e874646e75a09fbe9c9f248e2071bc4182973b7f (diff) | |
| download | perlweeklychallenge-club-5c1663e3f7a4bf8767cd62c4e7db03186561edb2.tar.gz perlweeklychallenge-club-5c1663e3f7a4bf8767cd62c4e7db03186561edb2.tar.bz2 perlweeklychallenge-club-5c1663e3f7a4bf8767cd62c4e7db03186561edb2.zip | |
Merge pull request #11 from manwar/master
update to week 12
Diffstat (limited to 'challenge-012/jaime')
| -rw-r--r-- | challenge-012/jaime/README | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/challenge-012/jaime/README b/challenge-012/jaime/README new file mode 100644 index 0000000000..46e62dafa4 --- /dev/null +++ b/challenge-012/jaime/README @@ -0,0 +1,23 @@ +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. |
