Code Golf: Just add water...
Have you ever seen those vaccum compressed towels, that look like a pill and after you add water became a towel?
That's our challenge for today. As usual shortest solution wins.
Task
You will receive an integer number and you will return a new number where each digit is repeated a number of times equals to its value.
Input:
42
Output:
444422
Note:
- Input is only made of digits [0-9]
- Zero returns an empty string
- Use this code to check the result length
- You also can use this test case here