8
this post was submitted on 02 Dec 2024
8 points (100.0% liked)
NotAwfulTech
6 readers
4 users here now
a community for posting cool tech news you don’t want to sneer at
non-awfulness of tech is not required or else we wouldn’t have any posts
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Got stuck forever on 2-2 because of an edge case that only showed up in 7/1000 reports, ended up just brute forcing it, just ran the fitness function after removing an element in sequence.
Then solved 3.x in like minutes because I could be worse at regex, posting code mostly because no-one else posted F# yet.
3-2 in F#
spoiler
comments
spoiler
Not much to say, the regex grabs all relevant strings and the folding function propagates a flag that flips according to do/don't and an accumulator that is increased when a mul() is encountered and parsed.