Suppose there is a triangle of digits like the following:
74932
1325
457
92
1
Each digit, with the exception of those in the top row, is equal to the last digit of the sum of
its upper and upper-right neighboring digits.
You will be given a String[] questionMarkTriangle containing a triangle where
only one digit in each row is known and all others are represented by '?'s
(see example 0 for clarification).
Each element of questionMarkTriangle represents a row of the triangle, and the rows are given
from top to bottom. Each element contains exactly one digit ('0'-'9') and
the remaining characters are all '?'s. Restore the triangle and return it as a
String[] without '?'s.
|