Imperative and functional-programming solutions for Jumping on the Cloud challenge
The thing about these "story" problems is that the story is often distracting, if not outright misleading, from the underlying problem to be solved.

In this case your code solves the challenge by calculating and counting the number of jumps it takes to get from the beginning to the end. More or less the way the story is layed out.  But it's worth noting:


The minimum number of jumps for a sequence of N zeros is always N/2.
At the end of every sequence of zeros is a 1 to be jumped over, except at the very end.


def jumpingOnClouds(c :Array[Int]) :Int =
  c.mkString.split("1").foldLeft(0)(_ + _.length/2 + 1) - 1


This isn't the most efficient solution possible but since the input Array is limited to no more than 100 elements I decided to go for brevity over efficiency.