Missing Spaces


Collapse Content

Given a string of text without spaces and a list of words, can you determine if the string of text can be fully divided into the words from the list? Print true if it can and false otherwise.

Here's the list of words to use for the challenge:

["a", "able", "are", "area", "be", "car", "care", "ear", "hello", "not", "note", "or", "to", "the", "world"]

Input

You are provided with boilerplate code to process the input, but here's the format in case you want to do it yourself:

The first line contains t for the number of test cases. t lines follow which each contain one line of text without any spaces.

Output

Output true or false for each line of input.

Sample Input/Output

3
helloworld
hellozworld
arearea
true
false
true

The first line can be split into hello world while the third line can be split into are area.

Challenge

Print true if the line of text can be split into the above words and false otherwise.

Please sign in or sign up to submit answers.

Alternatively, you can try out Learneroo before signing up.

Contact Us