Skip to content

compoundwords

bradendubois edited this page Jun 9, 2021 · 7 revisions

Compound Words

ID: compoundwords

Difficulty: 1.9

CPU Time: 1 second

Memory: 1024 MB

Solution

Read in every word into a list, and then (through two loops, or some other way) taking every pair a and b, check if a+b has not been found, and if not, add it to some list of compound words, then mark that it has been found; repeat with b+a. Then, sort that list and output every word.

Clone this wiki locally