Company: Edelwiess_14nov
Difficulty: medium
Longest Chain Problem Description Given an array of words representing a dictionary, test each word to see if it can be made into another word in the dictionary when characters are removed one at a time. Each word represents its own first element of its string chain, so start with a string chain of length 1. Each time a character is removed, increment the string chain by 1. In order to remove a character, the resulting word must be in the original dictionary. Determine the longest string chain achievable for a given dictionary. Example 1: Input: words = ["a","b","ba","bca","bda","bdca"] n = 6 Output: 4 Explanation: One of the longest chains is "a" -> "ba" -> "bda" -> "bdca". Constraints - 1 "ba" -> "bda" -> "bdca". The length is 4. Sample Case 1: Input: 4 a b ba bca Output: 3 Explanation: Words = ["a", "b", "ba", "bca"]. The longest chain is "a" -> "ba" -> "bca". The length is 3.