New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

array-sum-crowe-code-challenge

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-sum-crowe-code-challenge

sum two arrays and return in an array with integers separated by index

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

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

Keywords

array

FAQs

Package last updated on 27 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts