Sponsored
Use these hints if you're stuck. Try solving on your own first.
Discard all the spaces and dashes.
Use a while loop. While the string still has digits, check its length and see which rule to apply.
Solve with full IDE support and test cases