This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
let | |
graalvm21_2_0 = import (builtins.fetchGit { | |
# Descriptive name to make the store path easier to identify | |
name = "graalvm-21.2.0"; | |
url = "https://github.com/NixOS/nixpkgs"; | |
ref = "refs/heads/nixpkgs-unstable"; | |
rev = "e4dda76e6397fb1e30b907abeaf6a72bb055a1e6"; | |
}) {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns aoc21-01 | |
(:require [clojure.string :as str])) | |
(def input (map parse-long (str/split-lines (slurp "input.txt")))) | |
(defn answer-01 [input] | |
(count (filter true? (map < input (rest input))))) | |
(def three-sliding-window | |
(map + input (next input) (nnext input))) |