Cake and grief counseling will be available at the conclusion of the test.
git clone https://github.com/Metternich11/sum-intervals.git
Fork this repo and then git clone
your forked repo to your computer.
Write your function in index.js
Once you're happy with your solution, git push
and submit a pull request at
github.com/Metternich11/sum-intervals
.
// Write a function called sumIntervals that accepts an array of intervals and // returns the sum of all the interval lengths. Overlapping intervals // should only be counted once.
e.g. sumIntervals([[1,4], [3,5]]) ==> 4
To test your solution, run npm i
in the root directory
and then run npm t
to run the automated tests.
To submit your solution:
- If you're working on a forked repo, push your changes to your forked repo and submit a pull request to this repo.