Hackerrank – Simple Array Sum

Problem Statement
A description of the problem can be found on Hackerrank.

Solution
As this challenge is in Warmup subdomain, solution is pretty easy. The only thing to do is to be able to read from input given n times and make sum of all numbers.

I created solution in 4 languages:

All solutions are also available on my GitHub.

Scala

Java

JavaScript

Ruby