Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
3 added 589 characters in body
source | link

Jelly, 13 bytes

Dd4d2FṙJ$ḄṢIS

Try it online!

How it works

Dd4d2FṙJ$ḄṢIS  Main link. Argument: n

D              Decimal; convert n to base 10 (digit array).
 d4            Divmod 4; map each digit d to [d/4, d%4].
   d2          Divmod 2; map each [d/4, d%4] to [[d/8, d/4%2], [d%4/2, d%2]].
     F         Flatten the resulting 3D binary array.
      ṙJ$      Take all possible rotations.
         Ḅ     Convert each rotation from binary to integer.
          Ṣ    Sort the resulting integer array.
           I   Take the forward differences.
            S  Take the sum.

Jelly, 13 bytes

Dd4d2FṙJ$ḄṢIS

Try it online!

Jelly, 13 bytes

Dd4d2FṙJ$ḄṢIS

Try it online!

How it works

Dd4d2FṙJ$ḄṢIS  Main link. Argument: n

D              Decimal; convert n to base 10 (digit array).
 d4            Divmod 4; map each digit d to [d/4, d%4].
   d2          Divmod 2; map each [d/4, d%4] to [[d/8, d/4%2], [d%4/2, d%2]].
     F         Flatten the resulting 3D binary array.
      ṙJ$      Take all possible rotations.
         Ḅ     Convert each rotation from binary to integer.
          Ṣ    Sort the resulting integer array.
           I   Take the forward differences.
            S  Take the sum.
2 deleted 111 characters in body
source | link

Jelly, 1213 bytes

Dd4d2FṙRḄṢISDd4d2FṙJ$ḄṢIS

Too slow and memory hungry for the last two test cases. This could be fixed, at the cost of a byte, by replacing ṙR with ṙJ$.

Try it online!Try it online!

Jelly, 12 bytes

Dd4d2FṙRḄṢIS

Too slow and memory hungry for the last two test cases. This could be fixed, at the cost of a byte, by replacing ṙR with ṙJ$.

Try it online!

Jelly, 13 bytes

Dd4d2FṙJ$ḄṢIS

Try it online!

1
source | link

Jelly, 12 bytes

Dd4d2FṙRḄṢIS

Too slow and memory hungry for the last two test cases. This could be fixed, at the cost of a byte, by replacing ṙR with ṙJ$.

Try it online!