You are viewing a single comment's thread. Return to all comments →
public static int jumpingOnClouds(List c) { // Write your code here int count=0,i=0;
while(i<c.size()){ if(i+2<c.size()&&c.get(i+2)!=1){ count++; System.out.println(i+" "+count); i=i+2; } else{ count++; System.out.println(i+" "+count); i=i+1; } } return count-1; }
Jumping on the Clouds
You are viewing a single comment's thread. Return to all comments →
public static int jumpingOnClouds(List c) { // Write your code here int count=0,i=0;