diff --git a/exercises.md b/exercises.md index 55e8c7b..48e2a54 100644 --- a/exercises.md +++ b/exercises.md @@ -30,15 +30,23 @@ cat words_100k.txt | match "a.*e.*i.*o.*u" | count 8 words have all five vowels (aeiou) ## 5. Which words have two l's in a row, two m's in a row, and two t's in a row? (they don't have to be in that order) -???Nothing prints out, no error messages in terminal. +Corrected. Needed to use file, words_370k.txt +cat words_370k.txt | match "ll" | match "tt" | match "mm" + noncommittally + +Used incorrect file, words_100k.txt. Nothing printed out, no error messages in terminal. cat words_100k.txt | match "l.+l.+m.+m.+t.+t" cat words_100k.txt | match "ll.+mm.+tt" cat words_100k.txt | match "l.*l.*m.*m.*t.*t" There are no words that have two l's, two m's, and two t's each in a row If using a match separately for each set of the "letters in a row," then a lot of words will match the criteria. - cat words_100k.txt | match "ll" + cat words_100k.txt | match "ll" | match "mm" cat words_100k.txt | match "mm" cat words_100k.txt | match "tt" + cat words_100k.txt | match "ll" | match "tt" + cat words_100k.txt | match "ll" | match "tt" | match "mm" + + ## 6. How many words have sixteen or more letters? cat words_100k.txt | length | order | put 16 | lessthan 0 1 -e | count @@ -70,7 +78,7 @@ cat words_100k.txt | length | put 10 | equal | count 9869 ## 8. What's the longest word which doesn't have any repeated letters? -??? Is this correct +This is correct... cat words_100k.txt | length | unique 1 | length | equal 0 2 | order 13 abcdeilnprtuy 13 unpredictably 13 abceghiloprty 13 copyrightable @@ -79,10 +87,19 @@ cat words_100k.txt | length | unique 1 | length | equal 0 2 | order 13 acegilmnopsty 13 salpingectomy ## 9. What's the longest word which only uses four different letters? -???tried this, error message. Thinking 4 unique letters +Corrected +cat words_100k.txt | unique |length |put 4 |equal |pluck 3 |length |order +re-read this and write about it.. +Prints out all unique letters with 4-letter words with the length in alphabetical order + Note: pluck 3 - selects just the word at index 3 + +Tried this, error message. Thinking 4 unique letters How do I change the length to sort "4" unique letters? - cat words_100k.txt | length | unique 1 | length | order -r + cat words_100k.txt | length | unique 1 | length | order -r | head Scrolled up to see longest word, elns, 13 senselessness + cat words_100k.txt | length | unique 1 | length | order -r | head + cat words_100k.txt | unique + cat words_100k.txt | unique | length ## 10. If you rearrange the letters in "sidebar," what other words can you create? cat words_100k.txt | match "s.*i.*d.*e.*b.*a.*r"