Untitled
unknown
plain_text
10 months ago
746 B
16
Indexable
/**
* Write a spell checker function
* The function uses a dictionary on file "dictoinary.txt" and returns true or false if an input string is part of the dictionary or not.
* The words in the dictionary are separated by \n (one words per line)
*
* example of dictionary.txt:
*
* apple
* orange
* bananas
* fire
* firefighter
*
* Suppose, for thet sake of this exercise, that the function's input is an array:
* dictionary = ["apple", "orange", "bananas", "fire", "firefighter"]
*
* Unsorted
*
* Follow-up: implement a prefix checker
* a -> true
* ap -> true
* apple -> true
* apples -> false
* "" -> false
*
*/Editor is loading...
Leave a Comment