Sponsored
Use these hints if you're stuck. Try solving on your own first.
What if you check every pair of strings (bruteforce)?
For every two strings, check if they can form a puzzle by comparing their last and first words.
Solve with full IDE support and test cases