Given a list of alien words, find the longest chain of words that follows the rule: each word must start with the last letter of the previous word. If multiple chains have the same maximum length, return the lexicographically smallest one.
Explanation: Step-by-step: 1. Start with 'tachyon'. 2. Find a word that starts with 'N', the last letter of 'tachyon', which is 'nectar'. 3. Find a word that starts with 'R', the last letter of 'nectar', which is 'yacht'.
Explanation: Step-by-step: 1. Start with 'starlight'. 2. Find a word that starts with 'T', the last letter of 'starlight', which is 'tiger'. 3. Find a word that starts with 'R', the last letter of 'tiger', which is 'ocean'.
Master coding challenges related to Strings and solve the [Backup] Galactic Dictionary problem optimally.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak