[contoh soal] 5870 – Smooth Visualization

One possible method to visualize a number with many digits whose values are from
1 to 7, inclusive, is to visualize each digit by a vertical column of '+' on a
background canvas of '*'.    The digit seven (7) would be visualized by a vertical
column of  seven '+', the digit six (6) would be visualized by a vertical column of
six '+' and so on.   For example, the number “1425” will be visualized as
***+
*+*+
*+*+
*+++
++++
Such representation is seen as jagged, as the difference between one column of '+'
and the next is greater than 1, and may be considered not aesthetically pleasing by
some.  You are asked to add the minimum number of columns to eliminate its jagged
nature and construct the following smoother visualization
********+
***+***++
**+++*+++
*++++++++
+++++++++
where the height of two adjacent columns of '+' differ by no more than one
Contact Us Application