(parse-int)))]
(map-indexed transform input)))
-(defn result-of [input]
- (as-> (parse-input input) it
- (iterate phase it)
- (nth it 100)
- (take 8 it)
- (str/join it)))
+(defn result-of
+ ([input]
+ (result-of 0 input))
+ ([offset input]
+ (as-> (parse-input input) it
+ (iterate phase it)
+ (nth it 100)
+ (drop offset it)
+ (take 8 it)
+ (str/join it))))
+
+(defn fft [input]
+ (->> (repeat 10000 input)
+ (str/join)
+ (result-of (->> input
+ (take 7)
+ (str/join)
+ (parse-int)))))
(defn day16 []
(let [[input] (get-list-from-file (input-file))]
(part1 (result-of input))
- #_(part2)))
+ (part2 (fft input))))