Company: Meril
Difficulty: medium
2. Minix Chains 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 length of 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 n = 4 words = [\'a\', \'and\', \'an\', \'bear\'] The word \'and\' could be reduced to \'an\' and then to \'a\' . The single character a cannot be reduced any further because there is not a null string in the dictionary. The word \'bear\' cannot be reduced at all. The longest string chain has a length of 3 . Input Format The first line contains an integer n , the length of words. The second line contains n space-separated strings, representing the dictionary of words. Outp