Day 2: Red-Nosed Reports

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://blocks.programming.dev/ if you prefer sending it through a URL

FAQ

  • janAkali@lemmy.one
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 day ago

    Cool to see another solution in Nim here =)

    (0..<record.len).anyIt(record.dup(delete(it)).validate)

    That’s smart. I haven’t thought of using iterators to loop over indexes (except in a for loop).

    I got stuck on part 2 trying to check everything inside a single loop, which kept getting more ugly.

    Yeah I’ve thought of simple ways to do this and found none. And looking at the input - it’s too easy to bruteforce, especially in compiled lang like Nim.