Question: In outer space, messages sent in space are vulnerable to alteration due to cosmic conditions and interference. To ensure the correctness of messages during transmission,
In outer space, messages sent in space are vulnerable to alteration due to cosmic conditions and interference. To ensure the correctness of messages during transmission, messages need to be encoded in a certain way. In this particular encoding system, characters in a message are followed by a number which indicates how many times the character is to be repeated. However, there's a twist: if the position of the character in the original message is odd the character is repeated one additional time, and if it's even one repetition is subtracted. Your task is to develop a function called CommsDecoder that will take the encoded message as input and return the decoded message to the main program. The main program will read the encoded message, pass it to the function CommsDecoder and print the returned value.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
