dictionary of distinct words. Find every word in it that can be written out exactly by joining at least two other words from the same list end to end. A word may be used more than once.
Return the words you find in any order.dictionary=['sun', 'flower', 'sunflower', 'pot', 'flowerpot', 'sunflowerpot', 'rain'] → ['sunflower', 'flowerpot', 'sunflowerpot']
sunflower = sun + flower, flowerpot = flower + pot, sunflowerpot = sun + flower + pot. The word rain cannot be built from the others.
dictionary=['ha', 'hahaha', 'hah'] → ['hahaha']
hahaha = ha + ha + ha: the same word may be used several times. hah cannot be built.
dictionary=['tree', 'house'] → []
dictionary=['sun', 'flower', 'sunflower', 'pot', 'flowerpot', 'sunflowerpot', 'rain']
['sunflower', 'flowerpot', 'sunflowerpot']
Run checks the first 3 tests in your browser. Submit checks all 97 tests on the server, hidden ones included.