Day 4: Perilous Pier

Megathread guidelines

  • 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

FAQ

  • mykl@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    1 day ago

    Uiua

    Brute force was fast enough. It just wraps the array around a scytale of increasing diameter until all given values in each row match.

    Fit ← /×≤1≡(⧻◴▽⊸≠@?)⍉⬚@?↯⊂∞
    Min ← ⊙◌⍢(+1|¬Fit)1
    "rgbrgbrgbr\n?rv\no??v???y\n??bg?v??\n??b?????\n???"
    ⊃(/+≡◇Min ⊜□|Min▽)⊸≠@\n