• + 0 comments

    def jumpingOnClouds(c):

    n = len(c)
    i = 0
    jump = 0
    
    if n == 2:
        return 1
    
    while i < n-2:
    
    
        if c[i+2] == 0:
            i = i+2
            jump += 1
    
    
        else:
            i = i+1
            jump += 1
    
    
    
    if c[-2] == 0 and c[-3] !=0:
        return jump + 1
    else:
        return jump