Skip to main content
added 16 characters in body
Source Link
Jonah
  • 33.8k
  • 4
  • 40
  • 94

J, 80 69 6960 bytes

[:+/@,1 [,2 3*((,.@1;];[:,/[;[:,./"3#"^:2#"{~)#:2 7 2)4 :'y(x-:x&*);._3~$x'&><

Try it online!Try it online!

-9 thanks to xash

J, 80 69 bytes

[:+/@,1 2 3*((,.@1;];[:,/[:,./"3#"{~)#:2 7 2)4 :'y(x-:x&*);._3~$x'&><

Try it online!

J, 80 69 60 bytes

[:+/@,[,2 3*((;[:,./^:2#"{~)#:2 7 2)4 :'y(x-:x&*);._3~$x'&><

Try it online!

-9 thanks to xash

deleted 741 characters in body
Source Link
Jonah
  • 33.8k
  • 4
  • 40
  • 94

J, 80 65 6169 bytes

1#.[:,1 2 3*#:@2 1 2*(3,:1,:3 3)((]-:*)#:@2 7 2);._3"2^:(<3)]

Try it online!

-15 thanks to inspiration I got after reading Neil's approach

There is currently a small bug in the 61 byte version. I'll fix it tomorrow -- meanwhile consider the other answer official.

original approach, 80 bytes

[:+/@,1 2 3*((,.@1;];[:,/[:,./"3#"{~)#:2 7 2)4 :'y([x-:*/@,:)&>/[:,(,.~3^/i.3x&*)<;;._3"$]_3~$x'&><

Try it online!Try it online!

J, 80 65 61 bytes

1#.[:,1 2 3*#:@2 1 2*(3,:1,:3 3)((]-:*)#:@2 7 2);._3"2^:(<3)]

Try it online!

-15 thanks to inspiration I got after reading Neil's approach

There is currently a small bug in the 61 byte version. I'll fix it tomorrow -- meanwhile consider the other answer official.

original approach, 80 bytes

[:+/@,1 2 3*((,.@1;];[:,/[:,./"3#"{~)#:2 7 2)([-:*/@,:)&>/[:,(,.~3^/i.3)<;._3"$]

Try it online!

J, 80 69 bytes

[:+/@,1 2 3*((,.@1;];[:,/[:,./"3#"{~)#:2 7 2)4 :'y(x-:x&*);._3~$x'&><

Try it online!

added 129 characters in body
Source Link
Jonah
  • 33.8k
  • 4
  • 40
  • 94

J, 80 65 61 bytes

1#.[:,1 2 3*#:@2 1 2*(3,:1,:3 3)((]-:*)#:@2 7 2);._3"2^:(<3)]

Try it online!

-15 thanks to inspiration I got after reading Neil's approach

There is currently a small bug in the 61 byte version. I'll fix it tomorrow -- meanwhile consider the other answer official.

original approach, 80 bytes

[:+/@,1 2 3*((,.@1;];[:,/[:,./"3#"{~)#:2 7 2)([-:*/@,:)&>/[:,(,.~3^/i.3)<;._3"$]

Try it online!

J, 80 65 61 bytes

1#.[:,1 2 3*#:@2 1 2*(3,:1,:3 3)((]-:*)#:@2 7 2);._3"2^:(<3)]

Try it online!

-15 thanks to inspiration I got after reading Neil's approach

original approach, 80 bytes

[:+/@,1 2 3*((,.@1;];[:,/[:,./"3#"{~)#:2 7 2)([-:*/@,:)&>/[:,(,.~3^/i.3)<;._3"$]

Try it online!

J, 80 65 61 bytes

1#.[:,1 2 3*#:@2 1 2*(3,:1,:3 3)((]-:*)#:@2 7 2);._3"2^:(<3)]

Try it online!

-15 thanks to inspiration I got after reading Neil's approach

There is currently a small bug in the 61 byte version. I'll fix it tomorrow -- meanwhile consider the other answer official.

original approach, 80 bytes

[:+/@,1 2 3*((,.@1;];[:,/[:,./"3#"{~)#:2 7 2)([-:*/@,:)&>/[:,(,.~3^/i.3)<;._3"$]

Try it online!

deleted 7 characters in body
Source Link
Jonah
  • 33.8k
  • 4
  • 40
  • 94
Loading
added 632 characters in body
Source Link
Jonah
  • 33.8k
  • 4
  • 40
  • 94
Loading
Source Link
Jonah
  • 33.8k
  • 4
  • 40
  • 94
Loading