@@ -0,0 +1,1871 @@
+import java.io.BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0Aimport java.util.Arrays;%0A%0A// https://www.hackerrank.com/challenges/jumping-on-the-clouds/problem%0Apublic class JumpingOnTheClouds %7B%0A%0A    private static final String SPACE = %22 %22;%0A    private static final int SENTINEL = -1;%0A    private static final int CUMULUS = 0;%0A%0A    private static int%5B%5D readClouds() throws IOException %7B%0A        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) %7B%0A            reader.readLine(); // ignore first line%0A            String%5B%5D split = reader.readLine().split(SPACE);%0A            int%5B%5D clouds = Arrays.stream(split).mapToInt(Integer::parseInt).toArray();%0A            return clouds;%0A        %7D%0A    %7D%0A%0A    private static int jumpClouds(int index, int jumps, int%5B%5D clouds) %7B%0A        int updatedIndex = index + jumps;%0A        if (updatedIndex %3E= clouds.length) %7B%0A            return SENTINEL;%0A        %7D%0A        int cloud = clouds%5BupdatedIndex%5D;%0A        return (cloud == CUMULUS) ? updatedIndex : SENTINEL;%0A    %7D%0A%0A    private static int getMinStepsToLastCloud(int%5B%5D clouds) %7B%0A        int steps = 0;%0A        int i = 0;%0A        while (i %3C clouds.length) %7B%0A            if (i == clouds.length - 1) %7B%0A                return steps;%0A            %7D%0A            int cloud = clouds%5Bi%5D;%0A            if (cloud == 1) %7B%0A                throw new IllegalStateException(%22Current cloud could not be 1. Index is: %22 + i);%0A            %7D%0A            int updatedIndex = jumpClouds(i, 2, clouds);%0A            i = (updatedIndex != SENTINEL) ? updatedIndex : jumpClouds(i, 1, clouds);%0A            steps += 1;%0A        %7D%0A        return steps;%0A    %7D%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        int%5B%5D clouds = readClouds();%0A        int minSteps = getMinStepsToLastCloud(clouds);%0A        System.out.println(minSteps);%0A    %7D%0A%7D%0A

Add solution for Jumping on the clouds problem.