Clojure Day 6 Advent of Code 2022 Tuning Trouble

  Рет қаралды 352

Fred Overflow

Fred Overflow

Күн бұрын

Пікірлер: 4
@salim444
@salim444 Жыл бұрын
just a note, the is a substring function called subs.
@henrymhp
@henrymhp Жыл бұрын
Nice solution! Sharing a different one here, leveraging `partition` and the fact that sets are distinct by definition: (defn find-marker [l payload] (->> payload (partition l 1) (map-indexed vector) (filter #(= (count (set (second %))) l)) ffirst (+ l))) (find-marker 4 (slurp "./day_06.txt"))
@salim444
@salim444 Жыл бұрын
nice, didn't think of using map-indexed and the lazy behavior of filter make this code performant
@MartinClausen
@MartinClausen Жыл бұрын
I came up with this: (->> (slurp "resources/input6.txt") (partition 4 1) (take-while #(apply (complement distinct?) %)) count (+ 4))
Clojure Day 7 Advent of Code 2022 No Space Left On Device
6:56
Fred Overflow
Рет қаралды 420
Clojure Day 8 Advent of Code 2022 Treetop Tree House
6:59
Fred Overflow
Рет қаралды 468
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34
Flipping Robot vs Heavier And Heavier Objects
00:34
Mark Rober
Рет қаралды 41 МЛН
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 108 МЛН
Cool Parenting Gadget Against Mosquitos! 🦟👶
00:21
TheSoul Music Family
Рет қаралды 12 МЛН
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 394 М.
15 years of Clojure - 15 reasons we love it!
1:05
Flexiana
Рет қаралды 2,5 М.
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
Clojure Day 12 Advent of Code 2022 Hill Climbing Algorithm
6:13
Clojure Day 11 Advent of Code 2022 Monkey in the Middle
5:47
Fred Overflow
Рет қаралды 244
The Most Legendary Programmers Of All Time
11:49
Aaron Jack
Рет қаралды 581 М.
Are these words "untranslatable" into English?
23:03
RobWords
Рет қаралды 163 М.
Clojure Day 15 Advent of Code 2022 Beacon Exclusion Zone
8:51
Fred Overflow
Рет қаралды 254
Clojure Day 9 Advent of Code 2022 Rope Bridge
6:57
Fred Overflow
Рет қаралды 262
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34