String Challenge:
Have the function StringChallenge(str) take the str parameter being passed and return a compressed version of the string using the Run-length encoding algorithm. This algorithm works by taking the occurrence of each repeating character and outputting that number along with a single character of the repeating sequence. For example, "wwwggopp" would return "3w2g1o2p". The string will not contain any numbers, punctuation, or symbols.
def StringChallenge(strParam):
return strParam
# keep this function call
print(StringChallenge(input()))
Once your function is working, take the final output string and combine it with your ChallengeToken, both in reverse order and separated by a colon.
Your ChallengeToken: 2bpx4jchm86
Examples:
Input: "aabbcde"
Output: 2a2b1c1d1e
Final Output: e1d1c1b2a2:68mhcj4xpb2
Input: "wwwbbbw"
Output: 3w3b1w
Final Output: w1b3w3:68mhcj4xpb2