Given a list of possible messages and a target transmission, determine the length of the longest chain of transmissions.
Explanation: Step-by-step: with input ['worldhello', 'world', 'hello'], we find the longest chain starting from 'worldhello' which is 'worldhello' and 'world'. Therefore, the output is 2.
Explanation: Step-by-step: with input ['hello', 'hell', 'hel', 'hello'], we find the longest chain starting from 'hello' which is 'hello', 'hell', 'hel', and 'hello' itself. Therefore, the output is 4.
Master coding challenges related to Strings and solve the [Backup] Galactic Transmission problem optimally.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak