[Question]
  [
In this challenge you will be simulating a frog jumping from lily-pad to lily-pad in a pond. A frog's jump distance is uniquely determined by the size of the lily pad it jumps from. So for example there are lily-pads that let a frog jump `1` unit, lily-pads that let a frog jump `2` units etc. A frog can never jump more or less than the allowed amount, nor can it jump out of the pond, but it can jump in either direction.
So we will represent a lily-pad by the number of units it allows a frog to jump. This number is always positive. We will then represent a pond as a list of lily-pads.
Our question is then: If a frog starts on the first lily-pad can they visit every lily-pad in the pond by following the jumping rules?
For example if we have the following pond the answer is yes
```
[2, 3, 1, 4, 1]
 üê∏
[2, 3, 1, 4, 1]
       üê∏
[2, 3, 1, 4, 1]
    üê∏
[2, 3, 1, 4, 1]
             üê∏
[2, 3, 1, 4, 1]
          üê∏
```
However for the following pond the answer is no:
```
[3,2,1,2,1,2]
```
The frog can never reach any lily-pad labeled with a 1.
The frog is allowed to visit the same lily-pad more than once. The following example requires it:
```
[2, 1, 1, 1]
 üê∏
[2, 1, 1, 1]
       üê∏
[2, 1, 1, 1]
    üê∏
[2, 1, 1, 1]
       üê∏
[2, 1, 1, 1]
          üê∏
```
Some lily-pads are dead ends and need to be visited last for example:
```
[2,3,1,1]
```
Here there is nowhere to go from `3` so that has to be the final pad.
## Task
For this task you will take as input a non-empty list of positive integers. You should output one of two distinct values, the first if it a frog can reach every lily-pad the second if not.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so your goal is to minimize the size of your source code as measured in bytes.
## Test cases
### Possible
```
[10]
[2,1,1,1]
[3,1,4,2,2,1]
[6,1,1,1,1,1,3]
[2,3,1,1]
[2,2,1,2]
[8,9,1,5,2,5,1,7,4]
```
### Impossible
```
[2,1]
[3,2,1,2,1,2]
[3,2,2,2,2,2]
[3,4,1,2,1,1]
[2,9,1,9]
[3,3,3,1,3,3]
```
  
[Answer]
# Python3, 151 bytes:
```
f=lambda n,s=[0],p=[]:len({*s})==len(n)or any(f(n,s+[t],p+[j])for i in[n[s[-1]],-1*n[s[-1]]]if-1<(t:=(s[-1]+i))<len(n)and p.count(j:=(s[-1],t))<len(n))
```
[Try it online!](https://tio.run/##ZY/BbsIwEETv/YrcsJNNFceBAsJfYvmQlloYwcZK3AOq@PawMYUqRnuw/WY8mvWXcOhQrn0/jlad2vPnvs0QBqUrA15psz19I/vNhytXaroi7/qsxQuzjGyFDmQr9NFwS9xlDjXqQZfCGChF/rgbZ0uxY2GrWASF43x3j2txn/n3r@4HAzs@dAhPnY@@d6RZpkVlOH97PmsQ08yYJNJATTPnq7s3jkxS5EtK/A/1jK1hQ2xJypLOD2j@1UW5yOtq3ixpFfNeMmVsGifhzZ8/7TV12CReGTeQca/xBg)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~40~~ 37 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
ƒÅ<¬©+¬ÆI-√∏Œµ¬Æ√É}.ƒÅƒáU¬©√¶Œµ¬Æ¬´≈ìŒµX≈°√º2ŒµR`–ΩsŒ∏√•]P√†
```
05AB1E lacks recursive methods unfortunately, so we'll have to use a brute-force approach by first generating all possible results before validating them. Unfortunately, this is both extremely slow and pretty long - although it's probably golfable here and there.
[Try it online](https://tio.run/##yy9OTMpM/f//SKPNoZXah9Z56h7ecW7roXWHm2v1jjQeaQ89tPLwMpDAodVHJ5/bGnF04eE9Rue2BiVc2Ft8bsfhpbEBhxf8/x9tpKNgrKNgCESx/3V18/J1cxKrKgE) or [verify some smaller test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfaXS/yONNodWah9aV6l7eMe5rYfWHW6u1TvSeKQ99NDKw8tAAodWH518bmvE0YWH9xid2xqUcGFv8bkdh5fGBhxe8F9JL0znf3S0oUGsTrSRjiEIglnGUNoIWQTMQuabgNgKII1gIUugkCWQZaxjHBv7X1c3L183J7GqEgA).
**Explanation:**
Step 1: For each Lilly-pad index, check which other Lilly-pads the frog can jump to (which will always be 0, 1, or 2 other Lilly-pads):
```
ƒÅ        # Push a list in the range [1, (implicit) input-length]
 <       # Decrease each by 1 to the range [0, length)
  ¬©      # Store it in variable `¬Æ` (without popping)
   +     # Add it to the input-values at the same positions
¬Æ        # Push list `¬Æ` again
 I-      # Subtract the input-list at the same positions
    √∏    # Create pairs of these two lists
     Œµ   # Map each pair to:
      ¬Æ√É #  Only keep the values present in list `¬Æ`, removing any out-of-bounds
         # indices that are negative or >= the length)
     }.ƒÅ # After the map: enumerate the list, pairing each list with its index
```
[Try just step 1 online.](https://tio.run/##yy9OTMpM/f//SKPNoZXah9Z56h7ecW7roXWHm2v1jjT@/x9tpKNgrKNgCESx/3V18/J1cxKrKgE)
Step 2: Using the powerset and permutations builtins, create all possible lists that contain either 1 or 2 of these list-index pairs, and also start with the first Lilly-pad:
```
ƒá        # Extract head; pop and push remainder-list and first item separately
 U       # Pop this first item, and store it in variable `X`
 ¬©       # Store the remainder-list as new variable `¬Æ` (without popping)
  √¶      # Pop and push the powerset of this list
Œµ        # Map over each powerset-list:
 ¬Æ¬´      #  Merge list `¬Æ` to it
   ≈ì     #  Get all permutations of this list
    Œµ    #  Map over each permutation:
     X≈°  #   Prepend item `X` to each
```
[Try the first two steps online.](https://tio.run/##yy9OTMpM/f//SKPNoZXah9Z56h7ecW7roXWHm2v1jjQeaQ89tPLwMpDAodVHJ5/bGnF04X@d/9FGOgrGOgqGQBT7X1c3L183J7GqEgA)
Step 3: Check if there is any inner list for which all overlapping pairs of list-index pairs are valid jumps for the frog:
```
 √º2      #   Pop the list and push its overlapping pairs
   Œµ     #   Map each pair to:
    R    #    Reverse the pair
     `   #    Pop and push both inner pairs separated to the stack
      –Ω  #    Pop and and only leave the list
     s   #    Swap so the other pair is at the top of the stack
      Œ∏  #    Pop and only leave the index
       √• #    Check if this index is in the list
]        # Close all three open maps
 P       # Product to check for each inner-most list if ALL are truthy
  √†      # Flattened-max to check if ANY is truthy
         # (which is output implicitly as result)
```
[Answer]
# JavaScript (ES6), 83 bytes
Returns \$0\$ or \$1\$.
Given a list of \$N\$ entries, this recursively tries all possible paths where each lily-pad may be visited up to \$N\$ times.
```
f=(a,i=0,[...b]=a.map(_=>0))=>b.every(v=>v)||a[b[i]++]&&f(a,i+a[i],b)|f(a,i-a[i],b)
```
[Try it online!](https://tio.run/##dZDLDoIwFET3fgi0oTS8fLAoS7/AXW1MQVAMUgJIQsK/1xZZaCyZtM3ccyeZ9MEH3mVt2fRuLa65lAUBHJXEQxRjnDLC8ZM34EISD0KSpDgf8nYEA0kGOE2cprRkjsMsq9AxhyuLUjjNzl2czETdiSrHlbgBm57aV38fmQ033/MCUN9j8G8YIF/LQEI1j1CgZKK7T25WaOAHFCuyVemtevco0js/S/a5pkdedaaqwUoj3XY@K3SRkUZL1jf@gm4bG3Navr4VlW8 "JavaScript (Node.js) ‚Äì Try It Online")
Or **81 bytes** for this slower version suggested by [@tsh](https://codegolf.stackexchange.com/users/44718/tsh):
```
f=(a,i=0,[...b]=a.map(_=>0))=>a[b[i]++]?f(a,i+a[i],b)|f(a,i-a[i],b):b.every(v=>v)
```
[Try it online!](https://tio.run/##dZDfCoIwGMXvexE3nMP5pzKY3fUE3a0R07QMU1EbCL27beZF0eSwje/7nQOH3YUUXdoWTe9U9SUbx5wCgQrqIoYxTjgV@CEacKaxCyGNBUtYwW2b73Nts4WaUAJf0@TM0y7BmczaAUgaSzimddXVZYbL@gosdmyf/W3gFlx973PAiMvh39JDRMtAfLUPkKdkoutPbpJv4FsUKRKqdKjeDQq058dknSp2EGVnquotNNJtp7NAZxlpMGeJ8Rd028iY0yL6VnR8Aw "JavaScript (Node.js) ‚Äì Try It Online")
### Commented
```
f = (               // f is a recursive function taking:
  a,                //   a[] = input list
  i = 0,            //   i   = current position
  [...b] =          //   b[] = a list keeping track of how many times each
    a.map(_ => 0)   //         lily-pad was visited, initially all 0's
) =>                //
b.every(v => v)     // success if all lily-pads were visited at least once
||                  // otherwise:
a[b[i]++]           //   failed if a[b[i]] is not defined (either if we've
                    //   visited this position too many times, or we're out
                    //   of bounds and b[i] itself is undefined)
                    //   if applicable, increment b[i] afterwards
&&                  // otherwise:
f(a, i + a[i], b) | //   do a recursive call where we go to the right
f(a, i - a[i], b)   //   do a recursive call where we go to the left
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 49 bytes
```
‚äûœÖ‚ü¶‚Ä¶¬πÔº¨Œ∏‚Å∞‚üßÔº¶œÖÔº¶Œ¶Ôº•Œ∏‚ü¶‚Åª¬ßŒπ‚Å∞‚ü¶Œª‚üßŒª‚üß‚Ä∫‚Åº¬ßŒ∏¬ßŒπ¬π‚Üî‚ÅªŒª¬ßŒπ¬π‚ÑñœÖŒ∫‚äûœÖŒ∫¬¨¬ß‚åäœÖ‚Å∞
```
[Try it online!](https://tio.run/##XY49C8IwEIZ3f0XGC0Sw6tZJREWwUlxLh1hjG5omNk3Efx8vFT9wyIXj3ufuqRpuK8NVCLkfGvCMFCeuawEJIweha9dATykjs5Kmk6uxBDwl47@VygkLGb9Bj1QmtR9g5fb6Ih4gkUCqUCXWseys4DG/6T1X3yCiP0wST63Og1HeCXitVP@JmFkbr120bWNP3u4tSuZW4uho3OcG7pGd79A8WlGahlAUC7ZkCZvjS8oyTO/qCQ "Charcoal ‚Äì Try It Online") Link is to verbose version of code. Outputs a Charcoal boolean, i.e. `-` if possible, nothing if not. Explanation:
```
‚äûœÖ‚ü¶‚Ä¶¬πÔº¨Œ∏‚Å∞‚üßÔº¶œÖ
```
Start a breadth-first search having visited the first lily pad while the remaining lily pads are unvisited.
```
Ôº¶Œ¶Ôº•Œ∏‚ü¶‚Åª¬ßŒπ‚Å∞‚ü¶Œª‚üßŒª‚üß
```
Calculate the result of jumping to each lily pad...
```
‚Ä∫‚Åº¬ßŒ∏¬ßŒπ¬π‚Üî‚ÅªŒª¬ßŒπ¬π‚ÑñœÖŒ∫
```
... filtering out those jumps that were the wrong distance or have been seen before, ...
```
‚äûœÖŒ∫
```
... save the resulting position.
```
¬¨¬ß‚åäœÖ‚Å∞
```
Check whether any of the positions have no unvisited lily pads left.
[Answer]
# [Python 3](https://docs.python.org/3/), 96 bytes
```
f=lambda k,x=0,*s:len({*s})==len(k)or-1<x<len(k)>s.count(x)and f(k,x-k[x],x,*s)|f(k,x+k[x],x,*s)
```
[Try it online!](https://tio.run/##RU3BboMwDL33K3xMOncqhHYrKrt11112QxzSNqgIFlAIW6pt386MQVqeZL9nP790d39rrRrHMmv0x/mqocaQbXHdp42x4nvd/8osm2gtW7eJjuE4i5f@8dIO1osgtb1CKehuU@ehwEDH8ocHD/@D8etWNQbe3WDSFYB39xQ6V1FAKcynbkRlu8ELSY/WJlxM5@H09npyrnUpnJ3R9ZjHCAohQkioFqs82lKJMZpATFFPMCZMaj/PGYp9avGxA2Niz3ggtiO9o/6EyZzHWexZfIpTGaySZTenTRkHniv@g2rxBw "Python 3 ‚Äì Try It Online")
Port of my answer to [1D Hopping Array Maze](https://codegolf.stackexchange.com/a/247246/87681)
]