cswork / OA打开练习工作台

BloombergOA #3

Find Longest Chain

估计中等评测数据准备中,可先阅读题面

考点(AI 标注)树形博弈哈希计数

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.