Day 9: Movie Theater

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

  • skissue@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    10 hours ago

    Uiua

    My silly part one solution, because I have no idea how to do part two (this is usually the difficulty at which I bow out, but I want to try actually expanding my knowledge this year!).

    Parse         ← ⊜(⊜⋕⊸≠@,)⊸≠@\n
    CornerClosest ← ⊏⊢⍏⊸≡⌞(/+ⁿ2-)
    Big           ← 9999999
    RectSize      ← /×+1⌵-
    Part₁ ← (
      ∩⌟∩⌟CornerClosest 0_0 1000000_1000000 Big_0 0_Big
      ↥∩RectSize
    )
    
    $ 7,1
    $ 11,1
    $ 11,7
    $ 9,7
    $ 9,5
    $ 2,5
    $ 2,3
    $ 7,3
    
    &fras "9.txt"
    Part₁ Parse