• + 0 comments

    python3

    def jumpingOnClouds(c):
        # Write your code here
        
        counter = 0
        i = 0
        
        while i + 2 <= len(c) - 1:
            counter += 1
            if c[i + 2] == 0:
                i += 2
            else:
                i += 1
        
        if i == len(c) - 2:
            return counter + 1
        else:
            return counter