Hi, I'm having a go at this golfing question: https://codegolf.stackexchange.com/questions/239999/group-elements-by-their-displacement
Here's my solution, which seems to work:
{dist←|⍵-⍳⍴⍵ ⋄ dist ⊆⍥((⊂⍋dist)∘⌷) ⍵}t
The repeated dist makes me think there's an opportunity to shorten things with a fork or operator, but I can't quite manage to get there. Any suggestions welcome!