• + 0 comments
    function jumpingOnClouds(c) {
      
       
        let counter = 0; // minimal jumps
        
        if (c.length === 3){
            return 1
            
        }
       
            
            for (let i = 0;  i < c.length; i++){
                
                if (c[i] === 0){
                     if (c[i + 2] === 0){
                         counter++
                         i = i +1;
                         
       
                      } else {
                         if (c[i + 1] === 0 ){
                          counter++
                         
                          }
       
                      }
                    
                }
       
              
               
            }
       
        
        
        return counter
    
    }