Complete the method definition given below.
Given a coded message message
and a key, the method should decipher the code and return the decoded message back. The decoding rules are:
- Not all words in the coded message are part of the decoded message.
- Each word in the message will have a number as prefix.
- Any word that has a prefix number that is perfectly divisible by the key, then the word following the prefix number is part of the decoded message.
- The final decoded message will be returned as a string.
- Ensure there are no unnecessary trailing or leading whitespaces.