I provided the solutions found for each of the

exercises.

This was definitely a change as it required me to think a lot more about how each part of the command contributed
to what I needed to happen. While I am usually one to try and figure things out while working alone, this was actually
much easier to complete with the help of a study group as it required us to crowd source our process and have multiple
people working on the same problem at once with different angles in mind. I definitely see how this process can be helpful,
but at the same time this can often feel like adding extra steps to something that perhaps did not need it.
This commit is contained in:
Justin Toombs 2023-07-31 10:08:04 -04:00
parent 5e53633d04
commit dd16805344
4 changed files with 111010 additions and 10 deletions

View File

@ -10,32 +10,32 @@ If you want to be really stylish, put your code inside of backticks like this:
`cat words_100k.txt | length | put 10 | equal | count`
## 1. What is the longest word?
`cat words_100k.txt | length | order -r | head -n 1`
## 2. How many words have two u's in a row?
`cat words_100k.txt | match "uu" | count`
## 3. How many words have the word "cat" in them?
`cat words_100k.txt | match "cat" | count`
## 4. How many words have all five vowels (aeiou)?
`cat words_100k.txt | match "a" | match "e" | match "i" | match "o" | match "u" | count`
## 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)
`cat words_100k.txt | match "ll" | match "mm" | match "tt" | count`
## 6. How many words have sixteen or more letters?
`cat words_100k.txt | length | put 16 | lessthan 0 1 -e | count`
## 7. What's the most frequent 10-letter word?
`cat words_100k.txt | length | put 10 | equal 0 1 | frequency 2 | order -r | head -n 1`
## 8. What's the longest word which doesn't have any repeated letters?
`cat words_100k.txt | length | unique 1 | length | equal 0 2 | order -r | head -n 1`
## 9. What's the longest word which only uses four different letters?
`cat words_100k.txt | length | unique 1 | length | put 4 | equal | order 3 | tail -n 1`
## 10. If you rearrange the letters in "sidebar," what other words can you create?
`cat words_100k.txt | match "s" | match "i" | match "d" | match "e" | match "b" | match "a" | match "r"`

100000
words_100k.txt Normal file

File diff suppressed because it is too large Load Diff

10000
words_10k.txt Normal file

File diff suppressed because it is too large Load Diff

1000
words_1k.txt Normal file

File diff suppressed because it is too large Load Diff