Quest 8: The Art of Connection

  • Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
  • You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL

Link to participate: https://everybody.codes/

you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 1 year ago*

Uiua

Just a dirty great hack and a few minutes of toasty CPU for part3 with live data.

"1,5,2,6,8,4,1,7,3"
βŠœβ‹•βŠΈβ‰ @,
&p /+=βŠƒ(β§ˆβ‚‚(⌡/-)|Γ·2/β†₯) # Part1 --> 4

"1,5,2,6,8,4,1,7,3,5,7,8,2"
βŠœβ‹•βŠΈβ‰ @,
Knot  ← (βŠƒ(=Β―|=)∩⌞(Β±-)βŠ™Β°βŠŸ)
Knots ← /↧/β†₯β†―βˆž_2[∩⌟Knot]°⊟
β§ˆβ‚‚β†
&p /+≑(/+≑KnotsΒ€Β°βŠ‚β†™Β―)βŠ™Β€+1β†˜2β‡‘βŠΈβ§» # Part 2 --> 21

"1,5,2,6,8,4,1,7,3,6"
βŠœβ‹•βŠΈβ‰ @,
βŠƒ(β§…<2+1⇑⧻◴|β§ˆβ‚‚β†)            # Possible cuts, existing strings.
/β†₯+βŠƒ(β‰‘ΛœβˆŠβŠ™Β€|≑(/+≑KnotsΒ€)βŠ™Β€) # Part3 --> 7
  • source