• + 0 comments
    public static int jumpingOnClouds(List<Integer> c) {
    // Write your code here
    int count=0;
    int i=0;
    while(i+2<c.size()){
        if(c.get(i+2)==0)
        i+=2;
        else if(c.get(i+1)==0){
            i++;
        }
        count++;
    }
    if(i+1<c.size() && c.get(i+1)==0){
        count++;
    }
    return count;
    

    }