Can the string be split into a sequence of words from the dictionary? Words may be reused.
Input: line 1 — the string; line 2 — space-separated dictionary words. Output: true or false.
true
false
Your program reads from stdin and prints to stdout.
Example 1
Input: leetcode leet code
Output: true
Hints