Company: CoinSwitch_2Dec

Difficulty: medium

Problem Statement

Spell Fragmentation Decoder Problem Description An old enchanted parchment holds one long, unbroken string encodedString of strange runes. Hidden inside is a run of magic words, and to read the scroll you must cut this string into fragments that each spell out a real word. Luckily you also possess a spellbook dictionary of known magic words to guide the split. Your objective is to divide the string into valid words drawn from that dictionary so that the total count of words is as large as possible. Any time a fragment of the string, read contiguously, matches a dictionary word, you may claim it and keep splitting the remainder of the string in the same way. Implement the function maxWordsDecrypted to compute the maximum number of valid words the string can be split into, drawing only on the dictionary's words. 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 inte

More CoinSwitch_2Dec OA questionsInterview experiences