From 2a6d35e8a8cea34af73071439ae06c6c11311f3e Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 10 Jun 2019 06:03:50 +0100 Subject: - Added template for Challenge 012. --- challenge-012/jaime/README | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 challenge-012/jaime/README (limited to 'challenge-012/jaime') 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. -- cgit