Skip to main content
deleted 1271 characters in body
Source Link
att
  • 21.7k
  • 2
  • 16
  • 62

Wolfram Language (Mathematica), 28 bytes

GatherBy[#,i=0;Abs[#-++i]&]&

Try it online!


Wolfram Language (Mathematica), 25 bytes

GroupBy[i=0;Abs[#-++i]&]&

Try it online!

Looser IO format. Input [][array], and outputs an association whose values are the groups (keyed by their displacements).

Wolfram Language (Mathematica), 28 bytes

GatherBy[#,i=0;Abs[#-++i]&]&

Try it online!


Wolfram Language (Mathematica), 25 bytes

GroupBy[i=0;Abs[#-++i]&]&

Try it online!

Looser IO format. Input [][array], and outputs an association whose values are the groups (keyed by their displacements).

Wolfram Language (Mathematica), 28 bytes

GatherBy[#,i=0;Abs[#-++i]&]&

Try it online!

Source Link
att
  • 21.7k
  • 2
  • 16
  • 62

Wolfram Language (Mathematica), 28 bytes

GatherBy[#,i=0;Abs[#-++i]&]&

Try it online!


Wolfram Language (Mathematica), 25 bytes

GroupBy[i=0;Abs[#-++i]&]&

Try it online!

Looser IO format. Input [][array], and outputs an association whose values are the groups (keyed by their displacements).