Company: CoinSwitch_2Dec
Difficulty: medium
Spell Fragmentation Decoder Problem Description You have discovered an ancient magical scroll containing a long continuous string encodedString of mysterious characters. This string encodes a sequence of magical words that must be deciphered by splitting it into valid fragments. Fortunately, you also have a dictionary of known magical words that can help decode the scroll. Your goal is to break the string into valid words using the dictionary and maximize the number of such words formed. Each time you find a word from the dictionary in the string (as a contiguous fragment), you may include it and continue recursively on the remaining part of the string. You need to implement the function maxWordsDecrypted to find the maximum number of valid words the string can be split into, using only the words in the dictionary. Input Format The input consists of the following structure: The first line contains a string encodedString representing the encoded magical text. The second line contains an