BloombergOA #3
Find Longest Chain
Estimated MediumStatement and editorial — judging is being prepared
Topics (AI-labelled)Tree & Game DPHashing
Given a dictionary of many words:
Example 1
Input:
words = ["bac", "ac", "a", "c", "bads"]
Output:
3
Explanation: The longest chain that can be formed starting with "bac" is "bac" -> "ac" -> "a", which has a length of 3.
Editorial
Loading solution…