array-sum-crowe-code-challenge
v1.0.3
Published
sum two arrays and return in an array with integers separated by index
Downloads
5
Readme
sumArray-npm-module
Addition With Arrays
Given two integers represented in arrays, A and B. Where each digit of the integer occupies an index in the array. Write an NPM module that allows a developer to produce the summation of integers A + B as array C.
The resulting array C should be formatted in the same way as A and B, each digit should occupy an index.
Examples
123 [1, 2, 3]
+ 456 [4,5,6]
-------
579 [5,7,9]
Another example:
11
+ 15
-------
26
A final example:
111
+ 15
-------
126
Double Digit number
123
+ 398
------
521
It is important that you return an array as the final result.
You can make the assumption that the two method arguments will always be arrays of integers. Don't worry about validating input..
How to run
$ npm test