← Back to challenges

Mumbling Challenge

PythonHardlogicloopsstringsinterview

Instructions

Create a function that takes a string s and modifies the given string as per the below examples:

Examples

mumbling("MubAshIr") ➞ "M-Uu-Bbb-Aaaa-Sssss-Hhhhhh-Iiiiiii-Rrrrrrrr"

mumbling("maTT") ➞ "M-Aa-Ttt-Tttt"

mumbling("Sample") ➞ "S-Aa-Mmm-Pppp-Llllll-Eeeeee"

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Find the Bug: Checking Even Numbers