Hackerrank – Ice Cream Parlor

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

Solution
For each ith price, check if ith price plus (i+1)th price is equal required amount.

I created solution in:

All solutions are also available on my GitHub.

Java

JavaScript

Scala

Ruby