Ad
  • Default User Avatar

    Please count the sheep, starting from the right of the array and ignoring zero-bsed numbering.

    [sheep, sheep, sheep, sheep, sheep, wolf, sheep, sheep] -front->     You are here at the front of the queue of sheep
       7      6      5      4      3            2      1
    

    Sheep number 2 is in danger as he is in front of the wolf.

  • Default User Avatar

    I have changed the description so that it makes sense. The warning is to the sheep that is in front of the wolf.

    back of queue sheep, sheep, sheep, wolf, SHEEP, sheep front of queue YOU ARE HERE
    The sheep at position 2 is in danger.