Solutions for Google Code Jam 2019 Round 1A at https://codingcompetitions.withgoogle.com/codejam/round/0000000000051635.
swift run Pylons < data/Pylons.in
python interactive_runner.py python data/GolfGophers.py 0 -- swift run GolfGophers
python interactive_runner.py python data/GolfGophers.py 1 -- swift run GolfGophers
I've created two solutions and wrote additional test cases.
This solution greedily finds the longest matching suffix and removes pairs from a linked list.
g++ -std=c++14 alien_rhyme.cpp && ./a.out < data/AlienRhyme.in
This solution uses a prefix tree (also called it a trie) and recursively finds pairs in different subtrees.
swift run AlienRhyme < data/AlienRhyme.in