How to Make an Array from every valid connected pin at a Select Node?

I found this incomplete code that seems to make a loop by getting length of Enum.

  1. Anyone know how to complete it - what connects to the -1/1 reroute pin?

And what did he mean by making an extra (unused index) in the enum?