hackerrank/interview_preparation_kit_warm_up_challenges.rb
# Complete the jumpingOnClouds function below.

Complete the jumpingOnClouds function below.
Complete the jumpingOnClouds function below .
def jumpingOnClouds(c)
  rc = 0
  jumpable = 0
  c.each_with_index do |d,i|
    jumpable = if d == 0
                 jumpable < 3 ? jumpable + 1 : 2
               else
                 0
               end
    rc += 1 if jumpable < 3 && d == 0 && i != 0
  end
  rc
end
def jumpingOnClouds ( c ) rc = 0 jumpable = 0 c . each_with_index do | d , i | jumpable = if d == 0 jumpable < 3 ? jumpable + 1 : 2 else 0 end rc += 1 if jumpable < 3 && d == 0 && i != 0 end rc end
Complete the jumpingOnClouds function below.
Complete the jumpingOnClouds function below .
c
<not_specific>