100-days-of-rust/Week-10/Day-70_Broken-Keyboard/README.md
2023-03-23 21:38:35 -04:00

37 lines
758 B
Markdown

# Broken Keyboard
Help! My keyboard is broken, only a few keys work any more. If I tell you what keys work, can you tell me what words I can write?
(You should use the trusty **dictionary1.txt** file, located at _assets_ folder).
## Input
A string of letters representing the keys that work on the keyboard, example:
```text
abcd
```
```text
qwer
```
```text
hjklo
```
## Output
Your program should emit the longest valid English language word you can make for each keyboard configuration.
## Challenge Output
```text
longestWord("abcd") ➞ "abaca"
longestWord("edcf") ➞ "deeded"
longestWord("bnik") ➞ "bikini"
longestWord("poil") ➞ "lollipop"
longestWord("vybu") ➞ "bubby"
longestWord("subtoxymerhlac") ➞ "carboxymethylcelluloses"
```