Convert a number from decimal to unary notation using a custom digit-to-symbol mapping.
Problem
You are given a non-negative integer written in decimal. Convert it to a unary representation using the following rules:
- Each decimal digit is replaced by a corresponding sequence of
0s. - The length of the sequence depends on the digit value.
- The output is formed by concatenating the sequences for all digits in order.
This is an implementation-style string transformation problem: interpret the input number digit by digit and build the required unary string exactly as specified by the encoding rules.
Goal
Produce the transformed representation for the given input number.
Input Format
- A single non-negative integer as a string or numeric token.
- The exact encoding rules are derived from the problem statement and must be followed character by character.
Output Format
- Print the unary-encoded representation of the given number.
- Do not print extra spaces or extra lines beyond the required output.
Constraints
- The input is a valid non-negative integer.
- The answer should be produced using straightforward iteration over the digits.
- Large inputs may require processing the number as a string rather than as an integer type.
Example 1
Input
12
Output
0010
Explanation
The digits are transformed independently and concatenated according to the unary encoding rule.
Premium problem context
Unlock deeper context for this problem
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.