Company: Nokia_7june
Difficulty: medium
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 string. 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. Function Description 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. Parameters: encodedString (String): A string representing the encoded magical text. The length of this string is between 1 ≤ length(encodedString) ≤ 100,000 . dictionarySize (int): An integer n repres