Ezvor

1181. Before and After Puzzle

MediumArray Preparing judge… LeetCode
ArrayHash TableStringSorting

Hints

Hint 1
What if you check every pair of strings (bruteforce)?
Hint 2
For every two strings, check if they can form a puzzle by comparing their last and first words.