Frog Solution attempt

Embed Size (px)

Citation preview

  • 8/18/2019 Frog Solution attempt

    1/1

    function FrogsJumping(stones, answer) {  //console.log(stones);  if(answer == null){  answer = [0];  }  if(stones.length == 2){  if(stones[1]-stones[0] ==2)

      answer.push(2);  else answer.push(1); 

    for(x=0; x