⎕IO←1
⍵/⍨0≤⍵
↑
⌷
{0::0⋄f≡⌽⍵[f←⍵/⍨0≤⍵]}
0⌈indices
≡
x y≥⎕IO
(vec[x]=y)∧(vec[y]=x)
⍸
{0::0⋄f≡⌽⍵[f←⍸0≤⍵]}
{a~|x@a:&-1<x}
f≡⌽⍵[⍬]
⍳n
⍋≡⊢
[-1, -2, -3] Truthy (no tunnels, that's OK)
⍒≡⌽
,0
1 0
⌽
2 3 0 1