Skip to content
This repository has been archived by the owner on Jan 20, 2018. It is now read-only.

ebarchukov/sum-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Use recursion to sum all the values contained within a jagged array

Overview

Write a recursive function to sum all the values a jagged array. Function Signature

Input

array {Array} - An array where each item could be an integer or an array of integers.

Output

sum {Number} - The sum of all numbers in the array. Example

Given each of the following arrays, the output should be 10

[ 1, 2, 3, 4 ] [ [ 1 ], [ 2, 3 ], [ 4 ] ] [ [ 1 ], [ [ 2, 3 ], [ 4 ] ] ]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published