concatenation value
to 0.left
pointer to the start of the array and right
pointer to the end of the array.left
is less than right
:
a. Calculate the number of digits in the number at right
pointer.
b. Calculate the concatenation of the numbers at left
and right
pointers.
c. Add the concatenation to the concatenation value
.
d. Increment left
and decrement right
.left
equals right
(array has an odd number of elements), add the value at left
to the concatenation value
.concatenation value
.