HF RL Explorer

Longest Word Chain

Longest Word Chain: a task in Terminal-Lego-15k (Harbor dataset). Write a Python program that finds the longest word chain from a given list of words. In a word chain, each subsequent word must begin with the letter that the previous word ended with. Each word can only be used once in the chain.

The task

Write a Python program that finds the longest word chain from a given list of words. In a word chain, each subsequent word must begin with the letter that the previous word ended with. Each word can only be used once in the chain.

Part of PrimeIntellect/Terminal-Lego-15k.