Compare commits
No commits in common. "454e468d93f4557463f41111eca349d5fa60c2f8" and "a846d59e2a364727db85c7f4435732dbc56f018e" have entirely different histories.
454e468d93
...
a846d59e2a
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1 @@
|
||||||
target
|
/target
|
||||||
result
|
|
||||||
|
|
318
Cargo.lock
generated
318
Cargo.lock
generated
|
@ -3,5 +3,321 @@
|
||||||
version = 3
|
version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "taoc2022"
|
name = "bitflags"
|
||||||
|
version = "1.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cc"
|
||||||
|
version = "1.0.77"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "clap"
|
||||||
|
version = "4.0.29"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"clap_derive",
|
||||||
|
"clap_lex",
|
||||||
|
"is-terminal",
|
||||||
|
"once_cell",
|
||||||
|
"strsim",
|
||||||
|
"termcolor",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "clap_derive"
|
||||||
|
version = "4.0.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014"
|
||||||
|
dependencies = [
|
||||||
|
"heck",
|
||||||
|
"proc-macro-error",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "clap_lex"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8"
|
||||||
|
dependencies = [
|
||||||
|
"os_str_bytes",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "errno"
|
||||||
|
version = "0.2.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
|
||||||
|
dependencies = [
|
||||||
|
"errno-dragonfly",
|
||||||
|
"libc",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "errno-dragonfly"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "heck"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hermit-abi"
|
||||||
|
version = "0.2.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "io-lifetimes"
|
||||||
|
version = "1.0.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "is-terminal"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330"
|
||||||
|
dependencies = [
|
||||||
|
"hermit-abi",
|
||||||
|
"io-lifetimes",
|
||||||
|
"rustix",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libc"
|
||||||
|
version = "0.2.137"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "linux-raw-sys"
|
||||||
|
version = "0.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "once_cell"
|
||||||
|
version = "1.16.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "os_str_bytes"
|
||||||
|
version = "6.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro-error"
|
||||||
|
version = "1.0.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro-error-attr",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
"version_check",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro-error-attr"
|
||||||
|
version = "1.0.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"version_check",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro2"
|
||||||
|
version = "1.0.47"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quote"
|
||||||
|
version = "1.0.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustix"
|
||||||
|
version = "0.36.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cb93e85278e08bb5788653183213d3a60fc242b10cb9be96586f5a73dcb67c23"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"errno",
|
||||||
|
"io-lifetimes",
|
||||||
|
"libc",
|
||||||
|
"linux-raw-sys",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "strsim"
|
||||||
|
version = "0.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "1.0.105"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tAoC2022"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"clap",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "termcolor"
|
||||||
|
version = "1.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
|
||||||
|
dependencies = [
|
||||||
|
"winapi-util",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-ident"
|
||||||
|
version = "1.0.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "version_check"
|
||||||
|
version = "0.9.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi"
|
||||||
|
version = "0.3.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
||||||
|
dependencies = [
|
||||||
|
"winapi-i686-pc-windows-gnu",
|
||||||
|
"winapi-x86_64-pc-windows-gnu",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi-i686-pc-windows-gnu"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi-util"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
|
||||||
|
dependencies = [
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi-x86_64-pc-windows-gnu"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-sys"
|
||||||
|
version = "0.42.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
|
||||||
|
dependencies = [
|
||||||
|
"windows_aarch64_gnullvm",
|
||||||
|
"windows_aarch64_msvc",
|
||||||
|
"windows_i686_gnu",
|
||||||
|
"windows_i686_msvc",
|
||||||
|
"windows_x86_64_gnu",
|
||||||
|
"windows_x86_64_gnullvm",
|
||||||
|
"windows_x86_64_msvc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_gnullvm"
|
||||||
|
version = "0.42.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_msvc"
|
||||||
|
version = "0.42.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_gnu"
|
||||||
|
version = "0.42.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_msvc"
|
||||||
|
version = "0.42.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnu"
|
||||||
|
version = "0.42.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnullvm"
|
||||||
|
version = "0.42.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_msvc"
|
||||||
|
version = "0.42.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "taoc2022"
|
name = "tAoC2022"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
clap = { version = "4.0", features = ["derive"] }
|
||||||
|
|
140
flake.lock
140
flake.lock
|
@ -1,140 +0,0 @@
|
||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"advisory-db": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1669846878,
|
|
||||||
"narHash": "sha256-2ks8+eP/MuH07KGUR7zO/cSRPyoYJIPQHDsj+hveN/U=",
|
|
||||||
"owner": "rustsec",
|
|
||||||
"repo": "advisory-db",
|
|
||||||
"rev": "b80f8edaa7e5ce5a6babcd61f14dddee77875c2c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "rustsec",
|
|
||||||
"repo": "advisory-db",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"crane": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"rust-overlay": "rust-overlay"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1669605882,
|
|
||||||
"narHash": "sha256-TiQtL5sUI5rp28S63v+VX25qNjcrc8Xeu+shf3g7Tj4=",
|
|
||||||
"owner": "ipetkov",
|
|
||||||
"repo": "crane",
|
|
||||||
"rev": "24591d5f8cc979f7b243b88a2d39da09976970ad",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "ipetkov",
|
|
||||||
"repo": "crane",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1650374568,
|
|
||||||
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667395993,
|
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667395993,
|
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1669900182,
|
|
||||||
"narHash": "sha256-EKxjHxRJnP1w+2nnm8pq4Uqkqa5McnfPXcO8cG8Mxzc=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "bcb6dbbe30ce7631e5a0865dff1ab9b63d92977d",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixpkgs-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"advisory-db": "advisory-db",
|
|
||||||
"crane": "crane",
|
|
||||||
"flake-utils": "flake-utils_2",
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rust-overlay": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": [
|
|
||||||
"crane",
|
|
||||||
"flake-utils"
|
|
||||||
],
|
|
||||||
"nixpkgs": [
|
|
||||||
"crane",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667487142,
|
|
||||||
"narHash": "sha256-bVuzLs1ZVggJAbJmEDVO9G6p8BH3HRaolK70KXvnWnU=",
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "rust-overlay",
|
|
||||||
"rev": "cf668f737ac986c0a89e83b6b2e3c5ddbd8cf33b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "rust-overlay",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
98
flake.nix
98
flake.nix
|
@ -1,98 +0,0 @@
|
||||||
{
|
|
||||||
description = "tAoC2022 - Nix Builder";
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
||||||
crane = {
|
|
||||||
url = "github:ipetkov/crane";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
|
||||||
advisory-db = {
|
|
||||||
url = "github:rustsec/advisory-db";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# my rust project
|
|
||||||
# taoc2022 = {
|
|
||||||
# url = "git+ssh://gitea@git.p7.co.nz/thornAvery/tAoC2022";
|
|
||||||
# flake = false;
|
|
||||||
# };
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, crane, flake-utils, advisory-db, ... }:
|
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
|
||||||
let
|
|
||||||
pkgs = import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
};
|
|
||||||
|
|
||||||
inherit (pkgs) lib;
|
|
||||||
|
|
||||||
craneLib = crane.lib.${system};
|
|
||||||
src = ./.;
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
] ++ lib.optionals pkgs.stdenv.isDarwin [
|
|
||||||
pkgs.libiconv
|
|
||||||
];
|
|
||||||
|
|
||||||
cargoArtifacts = craneLib.buildDepsOnly {
|
|
||||||
inherit src buildInputs;
|
|
||||||
};
|
|
||||||
|
|
||||||
my-crate = craneLib.buildPackage {
|
|
||||||
inherit cargoArtifacts src buildInputs;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
checks = {
|
|
||||||
inherit my-crate;
|
|
||||||
|
|
||||||
my-crate-clippy = craneLib.cargoClippy {
|
|
||||||
inherit cargoArtifacts src buildInputs;
|
|
||||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
|
||||||
};
|
|
||||||
|
|
||||||
my-crate-doc = craneLib.cargoDoc {
|
|
||||||
inherit cargoArtifacts src;
|
|
||||||
};
|
|
||||||
|
|
||||||
my-crate-fmt = craneLib.cargoFmt {
|
|
||||||
inherit src;
|
|
||||||
};
|
|
||||||
|
|
||||||
my-crate-audit = craneLib.cargoAudit {
|
|
||||||
inherit src advisory-db;
|
|
||||||
};
|
|
||||||
|
|
||||||
my-crate-nextest = craneLib.cargoNextest {
|
|
||||||
inherit cargoArtifacts src buildInputs;
|
|
||||||
partitions = 1;
|
|
||||||
partitionType = "count";
|
|
||||||
};
|
|
||||||
} // lib.optionalAttrs (system == "x86_64-linux") {
|
|
||||||
# cargo-tarpaulin only supports x86_64 systems
|
|
||||||
my-crate-coverage = craneLib.cargoTarpaulin {
|
|
||||||
inherit cargoArtifacts src;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
packages.default = my-crate;
|
|
||||||
|
|
||||||
apps.default = flake-utils.lib.mkApp {
|
|
||||||
drv = my-crate;
|
|
||||||
};
|
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
|
||||||
inputsFrom = builtins.attrValues self.checks;
|
|
||||||
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
cargo
|
|
||||||
rustc
|
|
||||||
rust-analyzer
|
|
||||||
];
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
|
@ -1,6 +1,3 @@
|
||||||
pub mod problem_01;
|
#![allow(non_snake_case)]
|
||||||
pub mod problem_02;
|
pub mod problem01;
|
||||||
pub mod problem_03;
|
pub mod problem02;
|
||||||
pub mod problem_04;
|
|
||||||
pub mod problem_05;
|
|
||||||
pub mod problem_06;
|
|
||||||
|
|
28
src/main.rs
28
src/main.rs
|
@ -1,27 +1,11 @@
|
||||||
use taoc2022::problem_01;
|
use tAoC2022::problem01;
|
||||||
use taoc2022::problem_02;
|
use tAoC2022::problem02;
|
||||||
use taoc2022::problem_03;
|
|
||||||
use taoc2022::problem_04;
|
|
||||||
use taoc2022::problem_05;
|
|
||||||
use taoc2022::problem_06;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("== Problem 01 ==");
|
println!("== Problem 01 ==");
|
||||||
println!("= a: {}", problem_01::solution_a());
|
println!("= a: {}", problem01::solutionA());
|
||||||
println!("= b: {}", problem_01::solution_b());
|
println!("= b: {}", problem01::solutionB());
|
||||||
println!("== Problem 02 ==");
|
println!("== Problem 02 ==");
|
||||||
println!("= a: {}", problem_02::solution_a());
|
println!("= a: {}", problem02::solutionA());
|
||||||
println!("= b: {}", problem_02::solution_b());
|
println!("= b: {}", problem02::solutionB());
|
||||||
println!("== Problem 03 ==");
|
|
||||||
println!("= a: {}", problem_03::solution_a());
|
|
||||||
println!("= b: {}", problem_03::solution_b());
|
|
||||||
println!("== Problem 04 ==");
|
|
||||||
println!("= a: {}", problem_04::solution_a());
|
|
||||||
println!("= b: {}", problem_04::solution_b());
|
|
||||||
println!("== Problem 05 ==");
|
|
||||||
println!("= a: {}", problem_05::solution_a());
|
|
||||||
println!("= b: {}", problem_05::solution_b());
|
|
||||||
println!("== Problem 06 ==");
|
|
||||||
println!("= a: {}", problem_06::solution_a());
|
|
||||||
println!("= b: {}", problem_06::solution_b());
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
static INPUT: &str = include_str!("input.txt");
|
static INPUT: &'static str = include_str!("input.txt");
|
||||||
|
|
||||||
fn solution(x: i32) -> i32 {
|
fn solution(x: i32) -> i32 {
|
||||||
let mut totals = vec![Default::default(); x.try_into().unwrap()];
|
let mut totals = vec![Default::default(); x.try_into().unwrap()];
|
||||||
let mut total = 0;
|
let mut total = 0;
|
||||||
for line in INPUT.lines() {
|
for line in INPUT.lines() {
|
||||||
if line.is_empty() {
|
if line == "" {
|
||||||
add_to_total(&mut totals, total);
|
add_to_total(&mut totals, total);
|
||||||
total = 0;
|
total = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -15,19 +15,21 @@ fn solution(x: i32) -> i32 {
|
||||||
return totals.iter().sum();
|
return totals.iter().sum();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn add_to_total(totals: &mut [i32], total: i32) {
|
fn add_to_total(totals: &mut Vec<i32>, total: i32) {
|
||||||
let mut i = total;
|
let mut i = total;
|
||||||
for n in totals.iter_mut() {
|
for n in totals.iter_mut() {
|
||||||
if i > *n {
|
if i > *n {
|
||||||
std::mem::swap(&mut (*n), &mut i);
|
let tmp = *n;
|
||||||
|
*n = i;
|
||||||
|
i = tmp;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn solution_a() -> i32 {
|
pub fn solutionA() -> i32 {
|
||||||
solution(1)
|
return solution(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn solution_b() -> i32 {
|
pub fn solutionB() -> i32 {
|
||||||
solution(3)
|
return solution(3);
|
||||||
}
|
}
|
0
src/problem02/input.txt
Normal file
0
src/problem02/input.txt
Normal file
9
src/problem02/mod.rs
Normal file
9
src/problem02/mod.rs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
static INPUT: &'static str = include_str!("input.txt");
|
||||||
|
|
||||||
|
pub fn solutionA() -> i32 {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn solutionB() -> i32 {
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -1,48 +0,0 @@
|
||||||
--- Day 2: Rock Paper Scissors ---
|
|
||||||
|
|
||||||
The Elves begin to set up camp on the beach. To decide whose tent gets to be closest to the snack storage, a giant Rock Paper Scissors tournament is already in progress.
|
|
||||||
|
|
||||||
Rock Paper Scissors is a game between two players. Each game contains many rounds; in each round, the players each simultaneously choose one of Rock, Paper, or Scissors using a hand shape. Then, a winner for that round is selected: Rock defeats Scissors, Scissors defeats Paper, and Paper defeats Rock. If both players choose the same shape, the round instead ends in a draw.
|
|
||||||
|
|
||||||
Appreciative of your help yesterday, one Elf gives you an encrypted strategy guide (your puzzle input) that they say will be sure to help you win. "The first column is what your opponent is going to play: A for Rock, B for Paper, and C for Scissors. The second column--" Suddenly, the Elf is called away to help with someone's tent.
|
|
||||||
|
|
||||||
The second column, you reason, must be what you should play in response: X for Rock, Y for Paper, and Z for Scissors. Winning every time would be suspicious, so the responses must have been carefully chosen.
|
|
||||||
|
|
||||||
The winner of the whole tournament is the player with the highest score. Your total score is the sum of your scores for each round. The score for a single round is the score for the shape you selected (1 for Rock, 2 for Paper, and 3 for Scissors) plus the score for the outcome of the round (0 if you lost, 3 if the round was a draw, and 6 if you won).
|
|
||||||
|
|
||||||
Since you can't be sure if the Elf is trying to help you or trick you, you should calculate the score you would get if you were to follow the strategy guide.
|
|
||||||
|
|
||||||
For example, suppose you were given the following strategy guide:
|
|
||||||
|
|
||||||
A Y
|
|
||||||
B X
|
|
||||||
C Z
|
|
||||||
|
|
||||||
This strategy guide predicts and recommends the following:
|
|
||||||
|
|
||||||
In the first round, your opponent will choose Rock (A), and you should choose Paper (Y). This ends in a win for you with a score of 8 (2 because you chose Paper + 6 because you won).
|
|
||||||
In the second round, your opponent will choose Paper (B), and you should choose Rock (X). This ends in a loss for you with a score of 1 (1 + 0).
|
|
||||||
The third round is a draw with both players choosing Scissors, giving you a score of 3 + 3 = 6.
|
|
||||||
|
|
||||||
In this example, if you were to follow the strategy guide, you would get a total score of 15 (8 + 1 + 6).
|
|
||||||
|
|
||||||
What would your total score be if everything goes exactly according to your strategy guide?
|
|
||||||
|
|
||||||
Your puzzle answer was 14069.
|
|
||||||
--- Part Two ---
|
|
||||||
|
|
||||||
The Elf finishes helping with the tent and sneaks back over to you. "Anyway, the second column says how the round needs to end: X means you need to lose, Y means you need to end the round in a draw, and Z means you need to win. Good luck!"
|
|
||||||
|
|
||||||
The total score is still calculated in the same way, but now you need to figure out what shape to choose so the round ends as indicated. The example above now goes like this:
|
|
||||||
|
|
||||||
In the first round, your opponent will choose Rock (A), and you need the round to end in a draw (Y), so you also choose Rock. This gives you a score of 1 + 3 = 4.
|
|
||||||
In the second round, your opponent will choose Paper (B), and you choose Rock so you lose (X) with a score of 1 + 0 = 1.
|
|
||||||
In the third round, you will defeat your opponent's Scissors with Rock for a score of 1 + 6 = 7.
|
|
||||||
|
|
||||||
Now that you're correctly decrypting the ultra top secret strategy guide, you would get a total score of 12.
|
|
||||||
|
|
||||||
Following the Elf's instructions for the second column, what would your total score be if everything goes exactly according to your strategy guide?
|
|
||||||
|
|
||||||
Your puzzle answer was 12411.
|
|
||||||
|
|
||||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,102 +0,0 @@
|
||||||
mod types;
|
|
||||||
use types::*;
|
|
||||||
|
|
||||||
static INPUT: &str = include_str!("input.txt");
|
|
||||||
|
|
||||||
fn decode_rps(c: char) -> RpsHand {
|
|
||||||
match c {
|
|
||||||
'A' => RpsHand::Rock,
|
|
||||||
'X' => RpsHand::Rock,
|
|
||||||
'B' => RpsHand::Paper,
|
|
||||||
'Y' => RpsHand::Paper,
|
|
||||||
'C' => RpsHand::Scissors,
|
|
||||||
'Z' => RpsHand::Scissors,
|
|
||||||
_ => panic!("invalid input"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn decode_goal(c: char) -> Goal {
|
|
||||||
match c {
|
|
||||||
'X' => Goal::Lose,
|
|
||||||
'Y' => Goal::Draw,
|
|
||||||
'Z' => Goal::Win,
|
|
||||||
_ => panic!("invalid input"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn decode_plan(g: Goal, h: RpsHand) -> RpsHand {
|
|
||||||
match g {
|
|
||||||
Goal::Lose => h.wins_against(),
|
|
||||||
Goal::Draw => h.ties_with(),
|
|
||||||
Goal::Win => h.loses_to(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn process_input(input: &str, conv_func: fn(a: char, b: char) -> Game) -> Vec<Game> {
|
|
||||||
let mut games = vec![];
|
|
||||||
for line in input.lines() {
|
|
||||||
if !line.is_empty() {
|
|
||||||
if line.len() != 3 {
|
|
||||||
panic!("invalid input")
|
|
||||||
} else {
|
|
||||||
let a = line.chars().next().expect("invalid input");
|
|
||||||
let b = line.chars().nth(2).expect("invalid input");
|
|
||||||
games.push(conv_func(a, b));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
games
|
|
||||||
}
|
|
||||||
|
|
||||||
fn conv_game(a: char, b: char) -> Game {
|
|
||||||
Game {
|
|
||||||
opponent: decode_rps(a),
|
|
||||||
mine: decode_rps(b),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn conv_plan(a: char, b: char) -> Game {
|
|
||||||
let opp = decode_rps(a);
|
|
||||||
let goal = decode_goal(b);
|
|
||||||
Game {
|
|
||||||
opponent: opp,
|
|
||||||
mine: decode_plan(goal, opp),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn score_shape(s: &RpsHand) -> i32 {
|
|
||||||
match s {
|
|
||||||
RpsHand::Rock => 1,
|
|
||||||
RpsHand::Paper => 2,
|
|
||||||
RpsHand::Scissors => 3,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn score_outcome(g: &Game) -> i32 {
|
|
||||||
match (&g.mine, &g.opponent) {
|
|
||||||
(RpsHand::Rock, RpsHand::Scissors) => 6,
|
|
||||||
(RpsHand::Paper, RpsHand::Rock) => 6,
|
|
||||||
(RpsHand::Scissors, RpsHand::Paper) => 6,
|
|
||||||
_ => {
|
|
||||||
if g.mine == g.opponent {
|
|
||||||
3
|
|
||||||
} else {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn score_game(g: &Game) -> i32 {
|
|
||||||
score_shape(&g.mine) + score_outcome(g)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn solution_a() -> i32 {
|
|
||||||
let games = process_input(INPUT, conv_game);
|
|
||||||
games.iter().map(score_game).sum()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn solution_b() -> i32 {
|
|
||||||
let games = process_input(INPUT, conv_plan);
|
|
||||||
games.iter().map(score_game).sum()
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
#[derive(Eq, PartialEq, Clone, Copy)]
|
|
||||||
pub enum RpsHand {
|
|
||||||
Paper,
|
|
||||||
Scissors,
|
|
||||||
Rock,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl RpsHand {
|
|
||||||
pub fn loses_to(&self) -> RpsHand {
|
|
||||||
match *self {
|
|
||||||
RpsHand::Paper => RpsHand::Scissors,
|
|
||||||
RpsHand::Scissors => RpsHand::Rock,
|
|
||||||
RpsHand::Rock => RpsHand::Paper,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub fn wins_against(&self) -> RpsHand {
|
|
||||||
match *self {
|
|
||||||
RpsHand::Paper => RpsHand::Rock,
|
|
||||||
RpsHand::Scissors => RpsHand::Paper,
|
|
||||||
RpsHand::Rock => RpsHand::Scissors,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub fn ties_with(&self) -> RpsHand {
|
|
||||||
*self
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub enum Goal {
|
|
||||||
Lose,
|
|
||||||
Draw,
|
|
||||||
Win,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Eq, PartialEq)]
|
|
||||||
pub struct Game {
|
|
||||||
pub opponent: RpsHand,
|
|
||||||
pub mine: RpsHand,
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
--- Day 3: Rucksack Reorganization ---
|
|
||||||
|
|
||||||
One Elf has the important job of loading all of the rucksacks with supplies for the jungle journey. Unfortunately, that Elf didn't quite follow the packing instructions, and so a few items now need to be rearranged.
|
|
||||||
|
|
||||||
Each rucksack has two large compartments. All items of a given type are meant to go into exactly one of the two compartments. The Elf that did the packing failed to follow this rule for exactly one item type per rucksack.
|
|
||||||
|
|
||||||
The Elves have made a list of all of the items currently in each rucksack (your puzzle input), but they need your help finding the errors. Every item type is identified by a single lowercase or uppercase letter (that is, a and A refer to different types of items).
|
|
||||||
|
|
||||||
The list of items for each rucksack is given as characters all on a single line. A given rucksack always has the same number of items in each of its two compartments, so the first half of the characters represent items in the first compartment, while the second half of the characters represent items in the second compartment.
|
|
||||||
|
|
||||||
For example, suppose you have the following list of contents from six rucksacks:
|
|
||||||
|
|
||||||
vJrwpWtwJgWrhcsFMMfFFhFp
|
|
||||||
jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL
|
|
||||||
PmmdzqPrVvPwwTWBwg
|
|
||||||
wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn
|
|
||||||
ttgJtRGJQctTZtZT
|
|
||||||
CrZsJsPPZsGzwwsLwLmpwMDw
|
|
||||||
|
|
||||||
The first rucksack contains the items vJrwpWtwJgWrhcsFMMfFFhFp, which means its first compartment contains the items vJrwpWtwJgWr, while the second compartment contains the items hcsFMMfFFhFp. The only item type that appears in both compartments is lowercase p.
|
|
||||||
The second rucksack's compartments contain jqHRNqRjqzjGDLGL and rsFMfFZSrLrFZsSL. The only item type that appears in both compartments is uppercase L.
|
|
||||||
The third rucksack's compartments contain PmmdzqPrV and vPwwTWBwg; the only common item type is uppercase P.
|
|
||||||
The fourth rucksack's compartments only share item type v.
|
|
||||||
The fifth rucksack's compartments only share item type t.
|
|
||||||
The sixth rucksack's compartments only share item type s.
|
|
||||||
|
|
||||||
To help prioritize item rearrangement, every item type can be converted to a priority:
|
|
||||||
|
|
||||||
Lowercase item types a through z have priorities 1 through 26.
|
|
||||||
Uppercase item types A through Z have priorities 27 through 52.
|
|
||||||
|
|
||||||
In the above example, the priority of the item type that appears in both compartments of each rucksack is 16 (p), 38 (L), 42 (P), 22 (v), 20 (t), and 19 (s); the sum of these is 157.
|
|
||||||
|
|
||||||
Find the item type that appears in both compartments of each rucksack. What is the sum of the priorities of those item types?
|
|
||||||
|
|
||||||
Your puzzle answer was 8153.
|
|
||||||
--- Part Two ---
|
|
||||||
|
|
||||||
As you finish identifying the misplaced items, the Elves come to you with another issue.
|
|
||||||
|
|
||||||
For safety, the Elves are divided into groups of three. Every Elf carries a badge that identifies their group. For efficiency, within each group of three Elves, the badge is the only item type carried by all three Elves. That is, if a group's badge is item type B, then all three Elves will have item type B somewhere in their rucksack, and at most two of the Elves will be carrying any other item type.
|
|
||||||
|
|
||||||
The problem is that someone forgot to put this year's updated authenticity sticker on the badges. All of the badges need to be pulled out of the rucksacks so the new authenticity stickers can be attached.
|
|
||||||
|
|
||||||
Additionally, nobody wrote down which item type corresponds to each group's badges. The only way to tell which item type is the right one is by finding the one item type that is common between all three Elves in each group.
|
|
||||||
|
|
||||||
Every set of three lines in your list corresponds to a single group, but each group can have a different badge item type. So, in the above example, the first group's rucksacks are the first three lines:
|
|
||||||
|
|
||||||
vJrwpWtwJgWrhcsFMMfFFhFp
|
|
||||||
jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL
|
|
||||||
PmmdzqPrVvPwwTWBwg
|
|
||||||
|
|
||||||
And the second group's rucksacks are the next three lines:
|
|
||||||
|
|
||||||
wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn
|
|
||||||
ttgJtRGJQctTZtZT
|
|
||||||
CrZsJsPPZsGzwwsLwLmpwMDw
|
|
||||||
|
|
||||||
In the first group, the only item type that appears in all three rucksacks is lowercase r; this must be their badges. In the second group, their badge item type must be Z.
|
|
||||||
|
|
||||||
Priorities for these items must still be found to organize the sticker attachment efforts: here, they are 18 (r) for the first group and 52 (Z) for the second group. The sum of these is 70.
|
|
||||||
|
|
||||||
Find the item type that corresponds to the badges of each three-Elf group. What is the sum of the priorities of those item types?
|
|
||||||
|
|
||||||
Your puzzle answer was 2342.
|
|
||||||
|
|
||||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
|
|
@ -1,300 +0,0 @@
|
||||||
VdzVHmNpdVmBBCpmQLTNfTtMhMJnhFhTTf
|
|
||||||
FgqsZbqDDFqRrhhJnsnLMTfhJG
|
|
||||||
bRRRPrRRwSwbDqgjvDZbRbQzpzmQVWCzzBdvQBFCzlWV
|
|
||||||
GcDdRdvhRssRhGDdShCRtqWjlQzqWgqzNfNjfQWWjt
|
|
||||||
mwwnnPFwmVrPmJmzfNzqCjQCbgVlgC
|
|
||||||
nPnHHLrHwmJTrCTJpThBscBSdSLGZvZBvRhZ
|
|
||||||
RVQQcVlcSRclfZCCCnMJJTSTnC
|
|
||||||
NdHwjdwjbBBZrrZrbJDZJJ
|
|
||||||
wmhjGGBGwwmjtjtdPlfRcpVQlhRppVJF
|
|
||||||
pplbNBPPrppllrFNbpvppSTcwqcWFhTTShhJDTchqd
|
|
||||||
RGzRfLjjmZmfmwLftTWhStStJWTdWmDm
|
|
||||||
nfsMjQssnpPvNnrPrw
|
|
||||||
SjjBgllzlQjBZvlBBgcFbgJHsMhJqbMHPggJbM
|
|
||||||
hRLRVDdRRWnJqnnHTqMCnH
|
|
||||||
GRfLddRRpVhNVrWSjwQQzSzcGSBQSc
|
|
||||||
qMwNqqBdQdnTVBBVVhMVnVFzTHPggTPjGRDzvPTjjmvPDj
|
|
||||||
sbSrWJpStrtPtRPttzmmDD
|
|
||||||
pfbJJcbsrcLpWLllsnFmcqcwQncnQQqVNQ
|
|
||||||
RBTWCMwCwdZThPZcZZ
|
|
||||||
pVmVpHLFFFHHVgVmvNmHSQNvddlPPzZJMPcdhclhjczLdZMP
|
|
||||||
vnnNnFStGMRDwWnn
|
|
||||||
fWDdJTpDJzdBBBdmDSbSRHRwPqbPbHgSbz
|
|
||||||
slQtQvNsMVvrrgPRgRglnhwWPH
|
|
||||||
sGMMQFrsjvNMfWmdpfFDFZBf
|
|
||||||
vnMRMWCMJwWWwwWPjmSdVmLdzvVbLrhL
|
|
||||||
HsNfDHQlZpNqfQzbLbrqhjLmVdjd
|
|
||||||
dfDZQsNpstHHHptZDDtZWgngtgBMPMMRwCPtBBGW
|
|
||||||
HwQwwbwFNWHwHBVFQFLQzRznZnSzcjjjpPbcPpSP
|
|
||||||
vTfTJsCmsftJZmTSSdPvzdjRSvPdjd
|
|
||||||
TrGtTJfmGDfDhrhJJJsqrZhDBFLHHLLQWFwwlWBVBBVwgLFD
|
|
||||||
FFTJRLccQgmTbSsbGm
|
|
||||||
PBPPqCvCwqwhQQVhQngmVmSgglmGnHbnmb
|
|
||||||
zqthvtQPBfCCzPwQPtwQzPwNLfNRFNLdLRLFRFFNLFdFdW
|
|
||||||
nszjQnsPwjznzCCrhJqvjqhmBv
|
|
||||||
tFWdHGWFGtctlNNpZBBhmqTrrbWqvTBT
|
|
||||||
dlFtcpHDVVVHFdNGHGpGfQgsPDzSMsQwwPwgLLBQ
|
|
||||||
TzQqTJGvnnSzqrWTnvfbbcflQcVltfcCMPVM
|
|
||||||
jFjNZFFJLpFwmBwblcpptcVtfbbVlR
|
|
||||||
jmmJdBBLNdGDWDDrdzqn
|
|
||||||
pzddqQmGgbqgGpbJmmdnLZDCRZnZvFlLRZLSlLRT
|
|
||||||
rVwchcBBMwVBHhHTZCTSGSCRTZlTDr
|
|
||||||
HtccPfjfBhMtVBGHWpNqJdJdpjNJppWz
|
|
||||||
WThTWWhtPbZRvvWbbvRTSRMjVRLLgFssgLpVsfSF
|
|
||||||
JdwrlJcCwfzdqwwjsjzpLMgVsMFgML
|
|
||||||
lQrwHNGJHClvTmfhBmPQmt
|
|
||||||
lbRLhcLRpLJzgdGddF
|
|
||||||
qvhwqDDCVtBDVhfMVGFnzGGzTBnGzGGgFg
|
|
||||||
VjCwCWCMtjVDtChvQhtffcSmHpNWrrcHZHHZpplWbp
|
|
||||||
DJVDVdvpmZdPgrCbgbgCJC
|
|
||||||
lzczcWwwznGhBgPSvTlCrNgqNC
|
|
||||||
wGzzQhzGGsBBGRBcQwGwnwjmmRHpRfmmMpppMjjHDvLL
|
|
||||||
HJjJQWjFmmWtFmJTMchghhDwNMhVMWML
|
|
||||||
SznPSRfRSSPdrrPSShbDVhbLPwcwGGwVNh
|
|
||||||
ddRfzdRrCrRsZDSnFjspvFvqFqFqTvJt
|
|
||||||
lflfjQfjvljfbfMLTTDCmHNLNVbL
|
|
||||||
HSJnRrrJZJssnGRrnsrcqqRnDCLBMhVCTLVLhVNVJBBBhhBm
|
|
||||||
SsrGGqqnSsWSnnqWHSrPfzftvFdvWlwfQgQwWvzz
|
|
||||||
nQlsGnFGwwqNJWmJJjpplt
|
|
||||||
HMTLPTRdvsTCCThDCZdLdLDNNpJBWJbjJMpBmbtNptBWmm
|
|
||||||
DLCzPzTzZDdLdGSGfSGrsnQGzr
|
|
||||||
LNPPLHNPHQNQSBFDWDPgggFv
|
|
||||||
hszfWCWJhrBMsSSBgvFD
|
|
||||||
GGZjfmJTjmZfrJrZrZJRGwNQnlLNHWjLVjlwdVNHpV
|
|
||||||
BdNVdTcGVclmTwrTnwPwrHCr
|
|
||||||
zttBWzfLsCggHPwDrf
|
|
||||||
szsWSMbWzzbqBbzJjtjsvMzzvdmdVpGllpcRNZZhmRpZcGGc
|
|
||||||
CjdbMmmmZFnzzgHlttGBVqtBGtsldG
|
|
||||||
LvPPWNcFSSRslWhBsllT
|
|
||||||
ppccvLPpcSNwLLwrDNNpLvwJHCMDmbCJbFzgmZZmFgbgnM
|
|
||||||
TTNRwZqhcTTjsNTTsmrJlvrmmmqqHSrlJH
|
|
||||||
fLQCCdtcfCDDVbVVQdFbQbdJHMHrJHrHnMllHdMHPrMdln
|
|
||||||
WfQLQWWDbwRTWcRssN
|
|
||||||
HQGQWHPDHNjMNQGNWNTWCvZllzqFZqzvvzhCtvFj
|
|
||||||
DfgwdgfcFpchztvt
|
|
||||||
sRggdwwVdgmnSTnnDBPBNWLn
|
|
||||||
WbCZCfTVTTJjSwGdWNDGGw
|
|
||||||
MMRqggMsqhlmlhrssHgRnRmRvdzdczvdNGNLzScGDrNzrLNc
|
|
||||||
lRqsnRhmqqQnQpgQMlgDqRfBTJVFbJZQtBCbZQJVZFFb
|
|
||||||
JnhQcCnmLDsmgmgr
|
|
||||||
bbMZppRFGGRPfBMMRGMZssTTrLlLfsLlVLdsLsdn
|
|
||||||
GZGSpPGMZtGGPFFRGBCwhvwjjcnJctvQcvHq
|
|
||||||
vvrPrHZMGJNRMnqn
|
|
||||||
BVChWWcDVWsBwCWwGrJNhRLJJnJtLqnq
|
|
||||||
cjDfcfpWWsfWccBsHgPgrPTdpZbbgggv
|
|
||||||
GshtVtVtjSCVtVvVGtlVvFZLMvLRZmHmZwbLwZdLdZmR
|
|
||||||
JWzNDQzjcgJgQBJgzgMwLLHZZcdPwRLwRdHZ
|
|
||||||
QWTppBWfDrrNBTTfffhFCpVSjnhCGsFtsqSl
|
|
||||||
nmbCnzHHNzCjCJHJNSCWHLBLrvBrrSGRBDhrDRLrGL
|
|
||||||
TVtPllwcgdmTRhLQTQhT
|
|
||||||
fdFtccFcpPmggfdfNzHzCMsbCnWnJs
|
|
||||||
fMgddvjgRRvjvjVJVdTlZGGtGnrlnqTccNjl
|
|
||||||
HHSFSWSmmpbBpZlGncrNGbNtrn
|
|
||||||
WDWBDDBDBDCwPBWBDWNQDgzvVvLRvsVLRwvwdJVLwL
|
|
||||||
ZSmmvcpsmcJmJvqgBZgZqqtCtZjl
|
|
||||||
WhDwhFSDgtBFjnFg
|
|
||||||
rTrSTLWTTHNMNwNrMVddwNNhsmJGQcRsRcJGsJzQJsrzPsPm
|
|
||||||
GBtLmPsCQqsGqgghZHDzzgLbFz
|
|
||||||
zjjVTzTlRjRJfznrvrfpnNhFSghbbNFgHrbHZbDHbH
|
|
||||||
vpfcTJVpcVlfcQPMPCGzCBsd
|
|
||||||
HMhZNffcPZfNMrzjjFdGcJDjvJ
|
|
||||||
VSBVVLlSQQmTVSWpSQzDrHzTTvDvFjFdGGzT
|
|
||||||
mQSplVHWbHLSgWQnShNwsZMZPfbsNCRNCt
|
|
||||||
MMqvDzLwZzlMqQfdGWPfgPffPglH
|
|
||||||
ShTcJshsrRdnrdfrrfHp
|
|
||||||
VVRtFhsCJVJVvwQqDdbDQd
|
|
||||||
dmnNMlFNvmvljnbpMWNDFQvfQJJGvfPCfHGgQQgcJg
|
|
||||||
bRVzLBSSTRBRBBrwTrVtRwCfcGHcsJgJgzgGsggHCzcC
|
|
||||||
ZbtVTTrrqrSSVwhqqwBRwFWMDFNdjdZpWjdDDppjMW
|
|
||||||
MTzqtbLtwFzJgbHgfbdWWH
|
|
||||||
VMNBjNVjvNfhhhhfNPhP
|
|
||||||
jmGMvlDZZnVMtzlwzqqCpwFt
|
|
||||||
PpzGspGmpPsFLrTnTLzzBg
|
|
||||||
QCWvfjfWjRPFZgrvqrBvTg
|
|
||||||
wwNRCNQQVNRWjNWfQbHCCClHGDGJdGhpdhtPGhltDlJD
|
|
||||||
dhbpGzhllzGlPvnzNcvtNVnc
|
|
||||||
gcFMsTJDMMwrZqfjjqvvfnPtqJ
|
|
||||||
sWRWTRFwrTgLDDFWgMsTlpSlpbSCdWWdcbmpChGd
|
|
||||||
QccdFFFcFbcQPQPHMgpPMp
|
|
||||||
NJlNSSMLDfJfmlSqHZRNpRqNBRPRPq
|
|
||||||
LlMmJfvDVVTJSmVMscsCFtvwcjWjrjCj
|
|
||||||
NVVMGWFSMRVGWSthwhTJWzcJCcJsTs
|
|
||||||
jqRLqlfRZcmjcCzT
|
|
||||||
rlRRrdrflpdvPbHpflfPlfDBgBMQpGVQMgpVDGMggBDV
|
|
||||||
VwRhccRsnQStRhtGQVQVsmjgDgqJdggDjqLDgJlLzmLl
|
|
||||||
BWFZpWHBNCBCNBzBNvWBpzHZqqlMqgNdlllDdqDgJDLlfDdd
|
|
||||||
pFbTrrrBzbzTtSwStQnnsrVn
|
|
||||||
DRfFbFqzbddfPFtsJnJRsnClJRsn
|
|
||||||
cgjgQgWvSLVQgmWWgWVjVSSSBTltThLnqJssnTCZsTThntZT
|
|
||||||
qjwpSrmWgcSrGMfdFDFdwHFd
|
|
||||||
RWjDDWDjDNjjgDtSRRgjcjzFpnzwdFbFNdbFbpnldwFF
|
|
||||||
vQfPfTQJbZdThTzL
|
|
||||||
PrBQJQsfQqrrbfmPqMBfJbggjRVgWjttsHRSgRctDjSs
|
|
||||||
NgqNWqqWWdnJdqpBNFtCmJGCDHttDGDsHsHm
|
|
||||||
BjvzhRLTrTBQhTMQRjRRcjPGtmDCZZDZSCmmMSSZmVmSSt
|
|
||||||
vQzRvRzQcPcvfQzRnddppFgnFfWwBFlb
|
|
||||||
nnPvfvgrtPDHgvvGTRRRPZQGpGCLLV
|
|
||||||
FlBsBdbllFdfWpbGMCVMZLVbZQ
|
|
||||||
lhchNcqFsJBlBszztvwHjvzgrzmzffgH
|
|
||||||
zZhdjTpJJpjmmpPZhvqnnZHqZcggvgMbgv
|
|
||||||
tFpFQFSFtBGlFNwFfNMnHfbHcnvcvcfvcqrM
|
|
||||||
GBFlNLSNVGVSSGtQSLLBBlNtphDdzpmmPmTPhRmdzdVCCDdR
|
|
||||||
rpRCCDLpmnCdJCjn
|
|
||||||
vMhSFvgsMGLmnmWMmm
|
|
||||||
wVqFFvwvPPHhFhhgHPwHshpqrDDzqlfRbpftRLblrllr
|
|
||||||
CRNDzdJCVDWzVgDjdjzRJzWRMTbHsMNZNbZMMbsfhTtMTLMB
|
|
||||||
wSlwQcSpqPpcqcqFSqpwslsTfZtLhtlthtBHtTMZ
|
|
||||||
SPGFGFFmpcPGDrWDmjDJVffR
|
|
||||||
dsmdtJthJphWqHRPnRRsvvnnfR
|
|
||||||
cDBMDDDlBZglDZTMDfzVvNRrvNPVHzRRTV
|
|
||||||
PGMCCDClBDDbbFqmmhqQdpWGmmWp
|
|
||||||
BJjcGhcvCnBdGHsmHSzZDzSDMHmRMQ
|
|
||||||
qLWPLVrTwWlwwwrfrFfGDNmDQRMbQMzzmmbQLNMM
|
|
||||||
rVWrFlGqlqwVwVGgWGphnvgBBsnvsjdBnCBnBg
|
|
||||||
sNNsfBsmcGmgNTcHHSpnTWHnpV
|
|
||||||
QlrhlrlMglhDQrdFblvFtMdnDWwSHDWWwnTSjLwVDSwwwT
|
|
||||||
QtdMvltZhbFlPPZbQtQthZQdqCsJJGzBqqCBmCNCqgRCBsfP
|
|
||||||
SZnQnnHRWRQRVjHnqlJTQPfdlqfJftqG
|
|
||||||
pDzmbDBFbBLvvzttfdlTTl
|
|
||||||
gsDLLpcmsSZVwlnRsV
|
|
||||||
LHsWjwjWqCLsqCHcLsjdLqcdbpMGZPPtBhthbZBpBhMllwPG
|
|
||||||
VFnVbbvJSfbgphSpGlhRBBSP
|
|
||||||
JrrTgmFgzvNbrmNnmnvzgTLjCQWDLDCsTjssjqcHLc
|
|
||||||
QmwwqTqsrdqNNqgtvnVDVcGNNtvv
|
|
||||||
WBFBpzzjSJBJzJbfntgPzVzcvPnzDf
|
|
||||||
HcpbHZJBFpjpcSZrZsdRQZrCwrwd
|
|
||||||
JqmLmbtTWThBTWvWGVSrrVDsSGSG
|
|
||||||
wwzRzNjNNbsPVPds
|
|
||||||
jfgQRZwpQclQfffHgpRpwpfTcqtLLqCbbFFFLmbmTTBnFB
|
|
||||||
fGpcccNNqcctqGMprvMPmbbzFSflSRzPBBlBbS
|
|
||||||
JCjnjTZTTGPSGmTFPb
|
|
||||||
ZWHhJjHLDVDgHLLDGjnhctsstwqctNwWqNwwQrtv
|
|
||||||
sDwQhcwhBDDwrhGsQnRBQHHMHHMNJMZFCFRbCRftMM
|
|
||||||
zjjlmjqfdTqlWdzTqmLzlzVjNCHJNHNFMFtbJNZgVNMMCCtN
|
|
||||||
vPTfLmPTLWBsPDnSscnS
|
|
||||||
ngznwDPPTzhPPDCTQnTTDQBQqHNNrHFVppbbjRFFqFhHqRqr
|
|
||||||
tZJtcGsGtLLcctRqVBbbqrspbHNq
|
|
||||||
BmZSvGBMdWPzMPgnnz
|
|
||||||
MpNWPVNWWZWVVNZHVcvJjgBjJMStMJSjjg
|
|
||||||
rzdCzrCTTLRCslvJDSjjdScgDm
|
|
||||||
RLhCQzqTCssThRQzRzwGQrrCFffbfWppNpWNWVcHqZbHpVPp
|
|
||||||
zQzCVWdSSjCdjpchWcGftflGZcgG
|
|
||||||
RwnJTJwmvFHTBFmtBccZZfBGMstllM
|
|
||||||
wwvvHRwqDnHFrmqnrSbQVVQfSbqQjbqjbQ
|
|
||||||
ttDftStSlftPgSHmJbFwnMnFwzbrLHMMzz
|
|
||||||
GqTBqhBqBvppBvMMTznrCbCnLwfr
|
|
||||||
RBjjpZZvvZqGcNhjjpNmDPfDcsgfDfgScsQQQg
|
|
||||||
rsSFccvBHppHPsvQrSHSprFjnbLGdbzLfbGLLtLjjzLzvl
|
|
||||||
JWWJhmwwTDTGtnzlhdbtLG
|
|
||||||
CWNqWRNCwnCJVppQFFFFNrgHBB
|
|
||||||
MSRVnMjnVRVnPlcsrtMtschgDl
|
|
||||||
NWHBwJBwBBQCHHqwWQGBNgdrFFtsthcqdltdDsqttq
|
|
||||||
CCTTGCNCCBfNJNNWbGGnvVzDSRfDRSZvLPSzRn
|
|
||||||
MpRfjRjWpZzzzRzZSpjzZjTCQcGdHLWNGqdBdcBWWBLccn
|
|
||||||
lrbrsPQDPQglDtwggcLCqnCdNNdHBLsqNd
|
|
||||||
blwbJggvgbwlvQbvtgwmvVwRfTzfMMjFVfSFjZjMTSTSzj
|
|
||||||
ttSGjHWVrwWrWWvhzvhmhDfR
|
|
||||||
qMBdNNsccQgfDRzRmqlhRl
|
|
||||||
gQJdfJPdQBsMggMjPrTCLjrGrCrtVT
|
|
||||||
tGFdlwDwGFdNtStghWWdQFSnTVfCfZhrfVTVCVprnRRhVn
|
|
||||||
cLsBPQJsQPmbmPHTnRRnHprCVfns
|
|
||||||
MjmvPqqQjPbQzjLwwDWDSlzSlGSgwl
|
|
||||||
NSCpFgfbscbZZZwrtgPZJT
|
|
||||||
zGCQlVGmmQGVqqJwGtHZGrPHHRTH
|
|
||||||
qQvVmvzmqCdhhjzCQLjljLQMnMDSFWcSfnMfpbfnNcFFbFDN
|
|
||||||
zFgqjQBmWNlWlfHrHdLc
|
|
||||||
wnbCpSSZZTJSJSnmdrtHfGtftlcpltpH
|
|
||||||
ZSwhVPPJgNVmNFzs
|
|
||||||
WNVJthVHRRfLqpqN
|
|
||||||
gdCGcCgJBCrgScRLzbjQQLfRRR
|
|
||||||
SCFdGSFvlhTJsnvW
|
|
||||||
FFZwFZZwRmFFhHtNLNLGRtsqjLMt
|
|
||||||
gbDnnrMbMCffMPbPLNjGNlcppNtspp
|
|
||||||
rgbzrzDrgVgnrBzFWMWmWBwHWHShSB
|
|
||||||
zjRVjDqzRjvSBnBGGsfsrFsV
|
|
||||||
fLccLLZpJMctwJWWWJWpJGCwFwsgnngFBPsCnnTBPT
|
|
||||||
LbJlZNWMtpMlHRNHzdfSDfdj
|
|
||||||
VGbbnJGSTsVTssTTnVVWMtfBBmvftRHfHBMJJfZp
|
|
||||||
ghqtrzgPrjdzQCjmZMHfRHZHBmQmmB
|
|
||||||
gltFtDqFVlTVWlTl
|
|
||||||
HqNqZDTvNvVTLPSTvzfrfHfdndffwnbdnwrH
|
|
||||||
MpSJlFcMJmcpFlmClcMcRnWbWtthrnfwnCGrrWfrwC
|
|
||||||
RjcJJmSFMRQpMRFjMNVvTZjNPPvLTBPBBB
|
|
||||||
MzClDtlzJzFzNGGm
|
|
||||||
bjcLRHlTBsFJGmRm
|
|
||||||
HcPSSfTSpLZLbSwtrtvMnlDCDPCl
|
|
||||||
gWWgQJCsVhgRLCWsdjpmcBHvfvrrnvCvBB
|
|
||||||
TqDtztqtStlbNTPtllqZpvmcFHjNjvjNvHvmrrmj
|
|
||||||
ztPPGZqTPSbJgchGgwRQgQ
|
|
||||||
wVrdtTqtCCvbNgbNTTDN
|
|
||||||
mhGzWhGzMGWGrRmbFLBHZRNHNvZvgB
|
|
||||||
hhGhShpnsSrqVCVSSj
|
|
||||||
HnlbmGnlHZHnlBcjgwfDVfwLsGLGLDgR
|
|
||||||
WhWMWTvQPWPLDMFRCDMsVD
|
|
||||||
QdzJQPSPZqJnJRnZ
|
|
||||||
TTjTjFBcRBGjwsDTBLmrCftfRVrrCftCVNRP
|
|
||||||
WnqbJWnnQJhSqVfVPfDnggfrVN
|
|
||||||
hSlDMllvhbQqllZlSWQdSQTBjsFHBjTwGdHBTBszLzcc
|
|
||||||
rNWqWDLZWcqFqLLLgQQJnndnQdNzzJVMzd
|
|
||||||
cPtsPvChtRsGswHPGbwcPcdVnpzvnmBmVvJBJdJVJdzn
|
|
||||||
PfRfRGtsHsSRftbbbbHhwCCsjZgSTgSZWDTcgDZjLqgqFWLq
|
|
||||||
BNzPnPJNNMwHJRhBGRWRdjFQddFlFjWd
|
|
||||||
npbZrgnLSCSrWFjjdlZGlcDF
|
|
||||||
gqtmmngSbmgHJqfqzNBHBJ
|
|
||||||
stgzttBPRRRdpSVVpdpS
|
|
||||||
WJFcLQmJZHcCFLJmcZLMfbpGSWMNpGftSSpMrb
|
|
||||||
mcvvQvHmtLCJmHZQHZHCDHJJnjqPjjPzwvwhnwPqTjPBzPnB
|
|
||||||
DDmbbPqgFSbSQPtPQJttrltJ
|
|
||||||
CRfcnZWmRRhJNVtsVnQlsp
|
|
||||||
fcBvWvWzcZWCzTTCTTvccFMBHGDdSwGFFbqwFSGSmF
|
|
||||||
tCRBPCPRjzsJszBmtjmCvSpHcppJpvZdHHHcHZJG
|
|
||||||
qbrlLnWlQDQDNvmHHHHcrZZvdm
|
|
||||||
nmnWnnWmgQsCFzFCRVCg
|
|
||||||
sHMHCDZfcwMcRcLMcZDCRCHMPdJqgjvVdvqgdgfdJbQgvWQb
|
|
||||||
FFhTzmzGrnmtjTBjBBprrmFtqGgQqvVdPbbgqQQWJvvWJQqV
|
|
||||||
TrNjrnFSlwNZNlNL
|
|
||||||
JQGdsdzSzsdFQFSdssnndNlZjNPTJZNljVjTPhVPhT
|
|
||||||
GgGLfRmHGLhNVjjNTLhV
|
|
||||||
HvGvwpbHHRwpBrvBgSSzSFndtzndCrsFMd
|
|
||||||
DptFshMrhDhDwmPPhwSNhmmS
|
|
||||||
RLdcdRvBjnvRVcvlcLbCcbCwwpGBwSmfZqqPPPPwzmfqZq
|
|
||||||
VlRLvVjCJLnlpvvRdllLcJJWDHgMMHDDHtWFFDDQgH
|
|
||||||
SsSdrndpDlCdLftd
|
|
||||||
VGPVJgmQrVGHHZfwLlfCTmfwlDlT
|
|
||||||
PcJHcGgcWWbJpjRrphRbFpRn
|
|
||||||
PdPSMHMLzPPSShBdffMMzMRHQQrpppcqTCQQpCccTGTRCnCQ
|
|
||||||
vsbWmFbmJmZFFsmsbfpGVrGnWrrpVpnnVcTV
|
|
||||||
JZslstfZNNSSPdlSMwlM
|
|
||||||
bLLzRzZLbRqJJrDGGVZdwssDvGQw
|
|
||||||
FCtNJlTFtmPfldSvDvQFVVsjSv
|
|
||||||
PmCPHBhhPpWLWgzgHJ
|
|
||||||
qwmwFHCgPgPPqPwMCrHHFBVVRBttVRRffVfmsjVNNB
|
|
||||||
WSvcSnvbSWbhcbjlQbvlSQhlfBGcspVVsVGfVscpzpNcpBtN
|
|
||||||
hJSLhlvlTjPFHMLCCq
|
|
||||||
bggDpTggncGVVWbQcG
|
|
||||||
sRvSwwwFBSpFzvRvMFZqmPmMVqmcmPPVqhqqWq
|
|
||||||
SRBBrFZZwrddBFRjlptnLgDnTggdtd
|
|
||||||
PPfMcZMflbMQcMllPVfTVMwjWWmZvpWWpWhhjjpdWWww
|
|
||||||
sDQNnzsnQgDNsFzFqtGjGmWWSpWrGhdpvphdSW
|
|
||||||
nNQNqLBHLqzDnHgnVJfPJPCRBbfCcJlT
|
|
||||||
fppppWsjcSDPjjDpGhgwbfTgHTCbHJwbHbTR
|
|
||||||
rLBdQnvMNMmFPbLqHqTqgLHCgL
|
|
||||||
nrFznvMNMQdttrBcScsDstWcPGtWSc
|
|
||||||
lclnRSDnGZtvSwnZDZzhLffqdsCNwTBCBBdNsd
|
|
||||||
mPjmjmrFFpmQjMJQjlNdlhCsCLsTlNLs
|
|
||||||
ggmrHHVVQVPJpWrgpWScRvzZzGGRnZvlgzZn
|
|
||||||
GjGJGQJGcMTVfFDQzNVQzP
|
|
||||||
mHqdbmmdnJqVzVhRVNzPbR
|
|
||||||
wStmHJsJsLZLjTvM
|
|
||||||
QssMbVGdMQjZPjwVwHVZPZClllvgSgvlTgwwSSCgSCtC
|
|
||||||
WmmFBmJrcFRBFrJJBFchzWCStgCTgvhvTlfsNqfTlvTv
|
|
||||||
sFzzssDLzrBPjDVVddHMQD
|
|
||||||
fztDZSGrNrlnbnPTgFFpln
|
|
||||||
jvvQMMcLcjJmQwHdJvjQJnnbTbRFRphnnpsWgmFRPR
|
|
||||||
vTLHHCQLHBBjJCSZrVCZtSfSfrft
|
|
||||||
gHfHffHLjwHrRjLrLRZVMnTdTBsNTBwTVBsBnN
|
|
||||||
DWPhqhhDhvSGvWPzSzMBQBQVMMBBmvssvQvQ
|
|
||||||
CDGbqCDbChSbWGrHcHRgbcVcfrLJ
|
|
||||||
frlTLmtllbbbdpJS
|
|
||||||
qFjhzjThjHTFGHTjqhhjMzBhVpVpdbBnSJQRpBnVVdbRRQJd
|
|
||||||
vjWPWjWPPPWgwmfCrNvTvZ
|
|
|
@ -1,91 +0,0 @@
|
||||||
use std::cmp::Ordering;
|
|
||||||
|
|
||||||
static INPUT: &str = include_str!("input.txt");
|
|
||||||
|
|
||||||
fn item_priority(c: char) -> u8 {
|
|
||||||
if !c.is_ascii_alphabetic() {
|
|
||||||
panic!("invalid item in rucksack: {}", c);
|
|
||||||
}
|
|
||||||
match c {
|
|
||||||
'a'..='z' => (c as u8) - b'a' + 1,
|
|
||||||
_ => (c as u8) - b'A' + 27,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn split_input_line(l: String) -> (Vec<char>, Vec<char>) {
|
|
||||||
let n = l.len();
|
|
||||||
if n % 2 != 0 {
|
|
||||||
panic!("invalid line length");
|
|
||||||
}
|
|
||||||
let s = n / 2;
|
|
||||||
let mut c1 = l[0..s].chars().collect::<Vec<_>>();
|
|
||||||
c1.sort();
|
|
||||||
c1.dedup();
|
|
||||||
let mut c2 = l[s..n].chars().collect::<Vec<_>>();
|
|
||||||
c2.sort();
|
|
||||||
c2.dedup();
|
|
||||||
(c1, c2)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn parse_input_line(l: String) -> Vec<char> {
|
|
||||||
let mut c1 = l.chars().collect::<Vec<_>>();
|
|
||||||
c1.sort();
|
|
||||||
c1.dedup();
|
|
||||||
c1
|
|
||||||
}
|
|
||||||
|
|
||||||
fn find_items(c1: Vec<char>, c2: Vec<char>) -> Vec<char> {
|
|
||||||
let mut results = vec![];
|
|
||||||
let mut i1 = c1.iter().peekable();
|
|
||||||
let mut i2 = c2.iter().peekable();
|
|
||||||
while let (Some(a), Some(b)) = (i1.peek(), i2.peek()) {
|
|
||||||
match a.cmp(b) {
|
|
||||||
Ordering::Equal => {
|
|
||||||
results.push(**a);
|
|
||||||
i1.next();
|
|
||||||
i2.next();
|
|
||||||
}
|
|
||||||
Ordering::Less => {
|
|
||||||
i1.next();
|
|
||||||
}
|
|
||||||
Ordering::Greater => {
|
|
||||||
i2.next();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
results
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn solution_a() -> i32 {
|
|
||||||
let input = INPUT.lines().map(String::from).map(split_input_line);
|
|
||||||
input
|
|
||||||
.into_iter()
|
|
||||||
.map(|(a, b)| find_items(a, b))
|
|
||||||
.map(|x| match x.first() {
|
|
||||||
Some(y) => item_priority(*y) as i32,
|
|
||||||
_ => panic!("no matches found"),
|
|
||||||
})
|
|
||||||
.sum()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn solution_b() -> i32 {
|
|
||||||
let mut total = 0;
|
|
||||||
let mut input = INPUT.lines().map(String::from).map(parse_input_line);
|
|
||||||
loop {
|
|
||||||
let l1 = input.next();
|
|
||||||
let l2 = input.next();
|
|
||||||
let l3 = input.next();
|
|
||||||
match (l1, l2, l3) {
|
|
||||||
(Some(s1), Some(s2), Some(s3)) => {
|
|
||||||
let intermediate_matches = find_items(s1, s2);
|
|
||||||
let final_matches = find_items(s3, intermediate_matches);
|
|
||||||
match final_matches.first() {
|
|
||||||
Some(x) => total += item_priority(*x) as i32,
|
|
||||||
_ => panic!("no matches found"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => break,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
total
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
--- Day 4: Camp Cleanup ---
|
|
||||||
|
|
||||||
Space needs to be cleared before the last supplies can be unloaded from the ships, and so several Elves have been assigned the job of cleaning up sections of the camp. Every section has a unique ID number, and each Elf is assigned a range of section IDs.
|
|
||||||
|
|
||||||
However, as some of the Elves compare their section assignments with each other, they've noticed that many of the assignments overlap. To try to quickly find overlaps and reduce duplicated effort, the Elves pair up and make a big list of the section assignments for each pair (your puzzle input).
|
|
||||||
|
|
||||||
For example, consider the following list of section assignment pairs:
|
|
||||||
|
|
||||||
2-4,6-8
|
|
||||||
2-3,4-5
|
|
||||||
5-7,7-9
|
|
||||||
2-8,3-7
|
|
||||||
6-6,4-6
|
|
||||||
2-6,4-8
|
|
||||||
|
|
||||||
For the first few pairs, this list means:
|
|
||||||
|
|
||||||
Within the first pair of Elves, the first Elf was assigned sections 2-4 (sections 2, 3, and 4), while the second Elf was assigned sections 6-8 (sections 6, 7, 8).
|
|
||||||
The Elves in the second pair were each assigned two sections.
|
|
||||||
The Elves in the third pair were each assigned three sections: one got sections 5, 6, and 7, while the other also got 7, plus 8 and 9.
|
|
||||||
|
|
||||||
This example list uses single-digit section IDs to make it easier to draw; your actual list might contain larger numbers. Visually, these pairs of section assignments look like this:
|
|
||||||
|
|
||||||
.234..... 2-4
|
|
||||||
.....678. 6-8
|
|
||||||
|
|
||||||
.23...... 2-3
|
|
||||||
...45.... 4-5
|
|
||||||
|
|
||||||
....567.. 5-7
|
|
||||||
......789 7-9
|
|
||||||
|
|
||||||
.2345678. 2-8
|
|
||||||
..34567.. 3-7
|
|
||||||
|
|
||||||
.....6... 6-6
|
|
||||||
...456... 4-6
|
|
||||||
|
|
||||||
.23456... 2-6
|
|
||||||
...45678. 4-8
|
|
||||||
|
|
||||||
Some of the pairs have noticed that one of their assignments fully contains the other. For example, 2-8 fully contains 3-7, and 6-6 is fully contained by 4-6. In pairs where one assignment fully contains the other, one Elf in the pair would be exclusively cleaning sections their partner will already be cleaning, so these seem like the most in need of reconsideration. In this example, there are 2 such pairs.
|
|
||||||
|
|
||||||
In how many assignment pairs does one range fully contain the other?
|
|
||||||
|
|
||||||
Your puzzle answer was 466.
|
|
||||||
--- Part Two ---
|
|
||||||
|
|
||||||
It seems like there is still quite a bit of duplicate work planned. Instead, the Elves would like to know the number of pairs that overlap at all.
|
|
||||||
|
|
||||||
In the above example, the first two pairs (2-4,6-8 and 2-3,4-5) don't overlap, while the remaining four pairs (5-7,7-9, 2-8,3-7, 6-6,4-6, and 2-6,4-8) do overlap:
|
|
||||||
|
|
||||||
5-7,7-9 overlaps in a single section, 7.
|
|
||||||
2-8,3-7 overlaps all of the sections 3 through 7.
|
|
||||||
6-6,4-6 overlaps in a single section, 6.
|
|
||||||
2-6,4-8 overlaps in sections 4, 5, and 6.
|
|
||||||
|
|
||||||
So, in this example, the number of overlapping assignment pairs is 4.
|
|
||||||
|
|
||||||
In how many assignment pairs do the ranges overlap?
|
|
||||||
|
|
||||||
Your puzzle answer was 865.
|
|
||||||
|
|
||||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,60 +0,0 @@
|
||||||
static INPUT: &str = include_str!("input.txt");
|
|
||||||
|
|
||||||
struct ElfRange {
|
|
||||||
lower: i32,
|
|
||||||
upper: i32,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn split_ranges(s: &str) -> (ElfRange, ElfRange) {
|
|
||||||
let binding = String::from(s)
|
|
||||||
.split(|c| c == '-' || c == ',')
|
|
||||||
.map(|c| c.parse().expect("not a number!"))
|
|
||||||
.collect::<Vec<i32>>();
|
|
||||||
let mut ranges = binding.iter();
|
|
||||||
match (ranges.next(), ranges.next(), ranges.next(), ranges.next()) {
|
|
||||||
(Some(a), Some(b), Some(c), Some(d)) => (
|
|
||||||
ElfRange {
|
|
||||||
lower: *a,
|
|
||||||
upper: *b,
|
|
||||||
},
|
|
||||||
ElfRange {
|
|
||||||
lower: *c,
|
|
||||||
upper: *d,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
_ => panic!("error parsing input"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn total_overlap(a: ElfRange, b: ElfRange) -> bool {
|
|
||||||
(a.lower <= b.lower && a.upper >= b.upper) || (b.lower <= a.lower && b.upper >= a.upper)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn partial_overlap(a: ElfRange, b: ElfRange) -> bool {
|
|
||||||
(b.lower >= a.lower && b.lower <= a.upper)
|
|
||||||
|| (b.upper >= a.lower && b.upper <= a.upper)
|
|
||||||
|| (a.lower >= b.lower && a.lower <= b.upper)
|
|
||||||
|| (a.upper >= b.lower && a.upper <= b.upper)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn solution_a() -> i32 {
|
|
||||||
let mut total = 0;
|
|
||||||
for line in INPUT.lines() {
|
|
||||||
let (a, b) = split_ranges(line);
|
|
||||||
if total_overlap(a, b) {
|
|
||||||
total += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
total
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn solution_b() -> i32 {
|
|
||||||
let mut total = 0;
|
|
||||||
for line in INPUT.lines() {
|
|
||||||
let (a, b) = split_ranges(line);
|
|
||||||
if partial_overlap(a, b) {
|
|
||||||
total += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
total
|
|
||||||
}
|
|
|
@ -1,111 +0,0 @@
|
||||||
--- Day 5: Supply Stacks ---
|
|
||||||
|
|
||||||
The expedition can depart as soon as the final supplies have been unloaded from the ships. Supplies are stored in stacks of marked crates, but because the needed supplies are buried under many other crates, the crates need to be rearranged.
|
|
||||||
|
|
||||||
The ship has a giant cargo crane capable of moving crates between stacks. To ensure none of the crates get crushed or fall over, the crane operator will rearrange them in a series of carefully-planned steps. After the crates are rearranged, the desired crates will be at the top of each stack.
|
|
||||||
|
|
||||||
The Elves don't want to interrupt the crane operator during this delicate procedure, but they forgot to ask her which crate will end up where, and they want to be ready to unload them as soon as possible so they can embark.
|
|
||||||
|
|
||||||
They do, however, have a drawing of the starting stacks of crates and the rearrangement procedure (your puzzle input). For example:
|
|
||||||
|
|
||||||
[D]
|
|
||||||
[N] [C]
|
|
||||||
[Z] [M] [P]
|
|
||||||
1 2 3
|
|
||||||
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 3 from 1 to 3
|
|
||||||
move 2 from 2 to 1
|
|
||||||
move 1 from 1 to 2
|
|
||||||
|
|
||||||
In this example, there are three stacks of crates. Stack 1 contains two crates: crate Z is on the bottom, and crate N is on top. Stack 2 contains three crates; from bottom to top, they are crates M, C, and D. Finally, stack 3 contains a single crate, P.
|
|
||||||
|
|
||||||
Then, the rearrangement procedure is given. In each step of the procedure, a quantity of crates is moved from one stack to a different stack. In the first step of the above rearrangement procedure, one crate is moved from stack 2 to stack 1, resulting in this configuration:
|
|
||||||
|
|
||||||
[D]
|
|
||||||
[N] [C]
|
|
||||||
[Z] [M] [P]
|
|
||||||
1 2 3
|
|
||||||
|
|
||||||
In the second step, three crates are moved from stack 1 to stack 3. Crates are moved one at a time, so the first crate to be moved (D) ends up below the second and third crates:
|
|
||||||
|
|
||||||
[Z]
|
|
||||||
[N]
|
|
||||||
[C] [D]
|
|
||||||
[M] [P]
|
|
||||||
1 2 3
|
|
||||||
|
|
||||||
Then, both crates are moved from stack 2 to stack 1. Again, because crates are moved one at a time, crate C ends up below crate M:
|
|
||||||
|
|
||||||
[Z]
|
|
||||||
[N]
|
|
||||||
[M] [D]
|
|
||||||
[C] [P]
|
|
||||||
1 2 3
|
|
||||||
|
|
||||||
Finally, one crate is moved from stack 1 to stack 2:
|
|
||||||
|
|
||||||
[Z]
|
|
||||||
[N]
|
|
||||||
[D]
|
|
||||||
[C] [M] [P]
|
|
||||||
1 2 3
|
|
||||||
|
|
||||||
The Elves just need to know which crate will end up on top of each stack; in this example, the top crates are C in stack 1, M in stack 2, and Z in stack 3, so you should combine these together and give the Elves the message CMZ.
|
|
||||||
|
|
||||||
After the rearrangement procedure completes, what crate ends up on top of each stack?
|
|
||||||
|
|
||||||
Your puzzle answer was SBPQRSCDF.
|
|
||||||
--- Part Two ---
|
|
||||||
|
|
||||||
As you watch the crane operator expertly rearrange the crates, you notice the process isn't following your prediction.
|
|
||||||
|
|
||||||
Some mud was covering the writing on the side of the crane, and you quickly wipe it away. The crane isn't a CrateMover 9000 - it's a CrateMover 9001.
|
|
||||||
|
|
||||||
The CrateMover 9001 is notable for many new and exciting features: air conditioning, leather seats, an extra cup holder, and the ability to pick up and move multiple crates at once.
|
|
||||||
|
|
||||||
Again considering the example above, the crates begin in the same configuration:
|
|
||||||
|
|
||||||
[D]
|
|
||||||
[N] [C]
|
|
||||||
[Z] [M] [P]
|
|
||||||
1 2 3
|
|
||||||
|
|
||||||
Moving a single crate from stack 2 to stack 1 behaves the same as before:
|
|
||||||
|
|
||||||
[D]
|
|
||||||
[N] [C]
|
|
||||||
[Z] [M] [P]
|
|
||||||
1 2 3
|
|
||||||
|
|
||||||
However, the action of moving three crates from stack 1 to stack 3 means that those three moved crates stay in the same order, resulting in this new configuration:
|
|
||||||
|
|
||||||
[D]
|
|
||||||
[N]
|
|
||||||
[C] [Z]
|
|
||||||
[M] [P]
|
|
||||||
1 2 3
|
|
||||||
|
|
||||||
Next, as both crates are moved from stack 2 to stack 1, they retain their order as well:
|
|
||||||
|
|
||||||
[D]
|
|
||||||
[N]
|
|
||||||
[C] [Z]
|
|
||||||
[M] [P]
|
|
||||||
1 2 3
|
|
||||||
|
|
||||||
Finally, a single crate is still moved from stack 1 to stack 2, but now it's crate C that gets moved:
|
|
||||||
|
|
||||||
[D]
|
|
||||||
[N]
|
|
||||||
[Z]
|
|
||||||
[M] [C] [P]
|
|
||||||
1 2 3
|
|
||||||
|
|
||||||
In this example, the CrateMover 9001 has put the crates in a totally different order: MCD.
|
|
||||||
|
|
||||||
Before the rearrangement process finishes, update your simulation so that the Elves know where they should stand to be ready to unload the final supplies. After the rearrangement procedure completes, what crate ends up on top of each stack?
|
|
||||||
|
|
||||||
Your puzzle answer was RGLVRCQSB.
|
|
||||||
|
|
||||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
|
|
@ -1,514 +0,0 @@
|
||||||
[V] [B] [F]
|
|
||||||
[N] [Q] [W] [R] [B]
|
|
||||||
[F] [D] [S] [B] [L] [P]
|
|
||||||
[S] [J] [C] [F] [C] [D] [G]
|
|
||||||
[M] [M] [H] [L] [P] [N] [P] [V]
|
|
||||||
[P] [L] [D] [C] [T] [Q] [R] [S] [J]
|
|
||||||
[H] [R] [Q] [S] [V] [R] [V] [Z] [S]
|
|
||||||
[J] [S] [N] [R] [M] [T] [G] [C] [D]
|
|
||||||
1 2 3 4 5 6 7 8 9
|
|
||||||
|
|
||||||
move 1 from 8 to 4
|
|
||||||
move 1 from 7 to 8
|
|
||||||
move 1 from 6 to 3
|
|
||||||
move 2 from 6 to 5
|
|
||||||
move 8 from 5 to 1
|
|
||||||
move 5 from 3 to 8
|
|
||||||
move 1 from 7 to 8
|
|
||||||
move 8 from 1 to 2
|
|
||||||
move 3 from 3 to 9
|
|
||||||
move 13 from 8 to 7
|
|
||||||
move 2 from 1 to 2
|
|
||||||
move 1 from 6 to 2
|
|
||||||
move 2 from 1 to 7
|
|
||||||
move 4 from 4 to 2
|
|
||||||
move 10 from 9 to 4
|
|
||||||
move 7 from 4 to 1
|
|
||||||
move 1 from 6 to 7
|
|
||||||
move 2 from 4 to 5
|
|
||||||
move 1 from 5 to 2
|
|
||||||
move 1 from 5 to 8
|
|
||||||
move 3 from 1 to 5
|
|
||||||
move 2 from 4 to 6
|
|
||||||
move 2 from 6 to 4
|
|
||||||
move 2 from 4 to 5
|
|
||||||
move 5 from 1 to 5
|
|
||||||
move 1 from 9 to 5
|
|
||||||
move 1 from 8 to 5
|
|
||||||
move 14 from 2 to 6
|
|
||||||
move 12 from 7 to 4
|
|
||||||
move 4 from 6 to 7
|
|
||||||
move 3 from 6 to 4
|
|
||||||
move 4 from 4 to 9
|
|
||||||
move 2 from 4 to 6
|
|
||||||
move 2 from 9 to 3
|
|
||||||
move 9 from 4 to 3
|
|
||||||
move 2 from 1 to 6
|
|
||||||
move 5 from 7 to 3
|
|
||||||
move 4 from 7 to 8
|
|
||||||
move 2 from 6 to 7
|
|
||||||
move 3 from 6 to 7
|
|
||||||
move 10 from 5 to 8
|
|
||||||
move 8 from 8 to 9
|
|
||||||
move 10 from 9 to 7
|
|
||||||
move 12 from 7 to 5
|
|
||||||
move 1 from 1 to 5
|
|
||||||
move 3 from 7 to 2
|
|
||||||
move 10 from 3 to 7
|
|
||||||
move 6 from 5 to 7
|
|
||||||
move 2 from 6 to 1
|
|
||||||
move 12 from 2 to 7
|
|
||||||
move 3 from 3 to 1
|
|
||||||
move 1 from 6 to 5
|
|
||||||
move 10 from 5 to 7
|
|
||||||
move 3 from 3 to 4
|
|
||||||
move 34 from 7 to 1
|
|
||||||
move 2 from 6 to 9
|
|
||||||
move 1 from 6 to 3
|
|
||||||
move 3 from 1 to 3
|
|
||||||
move 1 from 7 to 3
|
|
||||||
move 3 from 3 to 6
|
|
||||||
move 1 from 4 to 3
|
|
||||||
move 22 from 1 to 6
|
|
||||||
move 2 from 9 to 7
|
|
||||||
move 2 from 4 to 9
|
|
||||||
move 12 from 6 to 8
|
|
||||||
move 1 from 7 to 6
|
|
||||||
move 4 from 8 to 2
|
|
||||||
move 1 from 7 to 1
|
|
||||||
move 6 from 8 to 9
|
|
||||||
move 1 from 2 to 5
|
|
||||||
move 1 from 2 to 7
|
|
||||||
move 13 from 1 to 2
|
|
||||||
move 2 from 3 to 1
|
|
||||||
move 4 from 7 to 5
|
|
||||||
move 3 from 9 to 4
|
|
||||||
move 1 from 1 to 8
|
|
||||||
move 4 from 5 to 2
|
|
||||||
move 12 from 6 to 2
|
|
||||||
move 3 from 1 to 3
|
|
||||||
move 1 from 4 to 1
|
|
||||||
move 9 from 8 to 5
|
|
||||||
move 6 from 5 to 7
|
|
||||||
move 2 from 4 to 5
|
|
||||||
move 5 from 9 to 6
|
|
||||||
move 5 from 3 to 7
|
|
||||||
move 30 from 2 to 6
|
|
||||||
move 11 from 7 to 9
|
|
||||||
move 36 from 6 to 3
|
|
||||||
move 10 from 9 to 3
|
|
||||||
move 1 from 6 to 5
|
|
||||||
move 3 from 5 to 2
|
|
||||||
move 2 from 5 to 2
|
|
||||||
move 28 from 3 to 4
|
|
||||||
move 6 from 4 to 1
|
|
||||||
move 1 from 2 to 3
|
|
||||||
move 2 from 5 to 2
|
|
||||||
move 6 from 1 to 7
|
|
||||||
move 1 from 1 to 6
|
|
||||||
move 6 from 3 to 5
|
|
||||||
move 6 from 7 to 2
|
|
||||||
move 1 from 6 to 4
|
|
||||||
move 2 from 2 to 6
|
|
||||||
move 8 from 2 to 1
|
|
||||||
move 3 from 2 to 4
|
|
||||||
move 2 from 3 to 4
|
|
||||||
move 4 from 3 to 4
|
|
||||||
move 1 from 6 to 1
|
|
||||||
move 2 from 1 to 8
|
|
||||||
move 1 from 6 to 4
|
|
||||||
move 1 from 9 to 3
|
|
||||||
move 2 from 5 to 4
|
|
||||||
move 1 from 8 to 7
|
|
||||||
move 1 from 7 to 9
|
|
||||||
move 1 from 3 to 5
|
|
||||||
move 1 from 8 to 6
|
|
||||||
move 34 from 4 to 9
|
|
||||||
move 13 from 9 to 8
|
|
||||||
move 1 from 8 to 2
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 4 from 5 to 1
|
|
||||||
move 9 from 8 to 7
|
|
||||||
move 11 from 1 to 3
|
|
||||||
move 1 from 4 to 2
|
|
||||||
move 1 from 6 to 7
|
|
||||||
move 1 from 9 to 4
|
|
||||||
move 1 from 4 to 1
|
|
||||||
move 1 from 5 to 3
|
|
||||||
move 5 from 7 to 8
|
|
||||||
move 1 from 2 to 5
|
|
||||||
move 1 from 5 to 1
|
|
||||||
move 21 from 9 to 5
|
|
||||||
move 19 from 3 to 4
|
|
||||||
move 17 from 4 to 6
|
|
||||||
move 2 from 8 to 4
|
|
||||||
move 2 from 6 to 8
|
|
||||||
move 2 from 6 to 9
|
|
||||||
move 2 from 7 to 6
|
|
||||||
move 1 from 4 to 9
|
|
||||||
move 6 from 5 to 6
|
|
||||||
move 1 from 9 to 8
|
|
||||||
move 8 from 5 to 7
|
|
||||||
move 15 from 6 to 2
|
|
||||||
move 1 from 9 to 7
|
|
||||||
move 2 from 1 to 6
|
|
||||||
move 3 from 4 to 7
|
|
||||||
move 1 from 1 to 6
|
|
||||||
move 3 from 5 to 4
|
|
||||||
move 2 from 5 to 6
|
|
||||||
move 2 from 4 to 1
|
|
||||||
move 13 from 7 to 8
|
|
||||||
move 2 from 6 to 4
|
|
||||||
move 3 from 2 to 4
|
|
||||||
move 2 from 7 to 6
|
|
||||||
move 5 from 4 to 6
|
|
||||||
move 4 from 2 to 6
|
|
||||||
move 1 from 1 to 9
|
|
||||||
move 18 from 8 to 3
|
|
||||||
move 1 from 4 to 5
|
|
||||||
move 1 from 2 to 7
|
|
||||||
move 15 from 3 to 1
|
|
||||||
move 1 from 5 to 1
|
|
||||||
move 3 from 3 to 4
|
|
||||||
move 1 from 5 to 4
|
|
||||||
move 1 from 5 to 6
|
|
||||||
move 1 from 6 to 8
|
|
||||||
move 2 from 8 to 2
|
|
||||||
move 3 from 1 to 8
|
|
||||||
move 6 from 2 to 8
|
|
||||||
move 1 from 7 to 6
|
|
||||||
move 12 from 8 to 5
|
|
||||||
move 2 from 9 to 6
|
|
||||||
move 6 from 1 to 5
|
|
||||||
move 9 from 5 to 3
|
|
||||||
move 1 from 2 to 8
|
|
||||||
move 20 from 6 to 9
|
|
||||||
move 3 from 6 to 7
|
|
||||||
move 1 from 7 to 1
|
|
||||||
move 7 from 3 to 4
|
|
||||||
move 2 from 7 to 2
|
|
||||||
move 1 from 8 to 7
|
|
||||||
move 8 from 4 to 1
|
|
||||||
move 11 from 1 to 7
|
|
||||||
move 10 from 7 to 6
|
|
||||||
move 2 from 4 to 9
|
|
||||||
move 21 from 9 to 3
|
|
||||||
move 6 from 5 to 9
|
|
||||||
move 6 from 3 to 2
|
|
||||||
move 1 from 4 to 5
|
|
||||||
move 1 from 7 to 9
|
|
||||||
move 8 from 3 to 2
|
|
||||||
move 9 from 2 to 1
|
|
||||||
move 14 from 1 to 6
|
|
||||||
move 1 from 1 to 7
|
|
||||||
move 4 from 3 to 8
|
|
||||||
move 3 from 8 to 7
|
|
||||||
move 5 from 7 to 4
|
|
||||||
move 3 from 6 to 9
|
|
||||||
move 2 from 3 to 7
|
|
||||||
move 3 from 5 to 6
|
|
||||||
move 1 from 5 to 6
|
|
||||||
move 2 from 7 to 9
|
|
||||||
move 1 from 8 to 3
|
|
||||||
move 22 from 6 to 5
|
|
||||||
move 3 from 9 to 4
|
|
||||||
move 3 from 6 to 1
|
|
||||||
move 5 from 4 to 6
|
|
||||||
move 9 from 2 to 8
|
|
||||||
move 4 from 6 to 1
|
|
||||||
move 1 from 3 to 2
|
|
||||||
move 1 from 2 to 3
|
|
||||||
move 6 from 8 to 1
|
|
||||||
move 2 from 4 to 3
|
|
||||||
move 10 from 1 to 7
|
|
||||||
move 2 from 8 to 7
|
|
||||||
move 1 from 9 to 6
|
|
||||||
move 4 from 3 to 5
|
|
||||||
move 1 from 8 to 3
|
|
||||||
move 4 from 9 to 8
|
|
||||||
move 1 from 4 to 3
|
|
||||||
move 1 from 3 to 8
|
|
||||||
move 3 from 7 to 6
|
|
||||||
move 1 from 1 to 5
|
|
||||||
move 10 from 5 to 9
|
|
||||||
move 5 from 6 to 4
|
|
||||||
move 5 from 8 to 5
|
|
||||||
move 4 from 9 to 8
|
|
||||||
move 3 from 3 to 9
|
|
||||||
move 2 from 8 to 6
|
|
||||||
move 5 from 7 to 5
|
|
||||||
move 1 from 4 to 1
|
|
||||||
move 1 from 1 to 2
|
|
||||||
move 2 from 8 to 6
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 1 from 7 to 2
|
|
||||||
move 1 from 1 to 5
|
|
||||||
move 28 from 5 to 9
|
|
||||||
move 3 from 6 to 1
|
|
||||||
move 1 from 6 to 9
|
|
||||||
move 1 from 2 to 9
|
|
||||||
move 2 from 1 to 2
|
|
||||||
move 2 from 7 to 5
|
|
||||||
move 1 from 7 to 5
|
|
||||||
move 1 from 2 to 5
|
|
||||||
move 3 from 1 to 9
|
|
||||||
move 1 from 5 to 8
|
|
||||||
move 15 from 9 to 2
|
|
||||||
move 11 from 9 to 4
|
|
||||||
move 11 from 4 to 7
|
|
||||||
move 2 from 4 to 1
|
|
||||||
move 7 from 7 to 8
|
|
||||||
move 1 from 1 to 4
|
|
||||||
move 20 from 9 to 1
|
|
||||||
move 2 from 7 to 8
|
|
||||||
move 1 from 4 to 6
|
|
||||||
move 1 from 6 to 2
|
|
||||||
move 2 from 7 to 5
|
|
||||||
move 1 from 9 to 6
|
|
||||||
move 1 from 4 to 9
|
|
||||||
move 4 from 5 to 2
|
|
||||||
move 1 from 6 to 8
|
|
||||||
move 1 from 4 to 9
|
|
||||||
move 11 from 8 to 3
|
|
||||||
move 1 from 1 to 9
|
|
||||||
move 1 from 5 to 9
|
|
||||||
move 1 from 2 to 6
|
|
||||||
move 4 from 9 to 8
|
|
||||||
move 4 from 8 to 7
|
|
||||||
move 10 from 1 to 6
|
|
||||||
move 7 from 1 to 5
|
|
||||||
move 8 from 3 to 4
|
|
||||||
move 2 from 3 to 5
|
|
||||||
move 3 from 7 to 4
|
|
||||||
move 1 from 4 to 5
|
|
||||||
move 2 from 1 to 6
|
|
||||||
move 9 from 2 to 6
|
|
||||||
move 1 from 7 to 9
|
|
||||||
move 1 from 3 to 2
|
|
||||||
move 7 from 4 to 3
|
|
||||||
move 3 from 3 to 7
|
|
||||||
move 5 from 2 to 3
|
|
||||||
move 1 from 1 to 9
|
|
||||||
move 2 from 2 to 7
|
|
||||||
move 1 from 4 to 6
|
|
||||||
move 3 from 5 to 6
|
|
||||||
move 4 from 7 to 6
|
|
||||||
move 1 from 7 to 4
|
|
||||||
move 1 from 4 to 7
|
|
||||||
move 1 from 2 to 8
|
|
||||||
move 1 from 7 to 1
|
|
||||||
move 27 from 6 to 2
|
|
||||||
move 1 from 4 to 1
|
|
||||||
move 7 from 5 to 7
|
|
||||||
move 1 from 4 to 1
|
|
||||||
move 1 from 8 to 3
|
|
||||||
move 3 from 7 to 3
|
|
||||||
move 2 from 1 to 6
|
|
||||||
move 2 from 9 to 1
|
|
||||||
move 18 from 2 to 1
|
|
||||||
move 2 from 7 to 5
|
|
||||||
move 12 from 3 to 4
|
|
||||||
move 1 from 5 to 6
|
|
||||||
move 3 from 6 to 1
|
|
||||||
move 24 from 1 to 8
|
|
||||||
move 9 from 2 to 4
|
|
||||||
move 3 from 2 to 1
|
|
||||||
move 2 from 6 to 3
|
|
||||||
move 1 from 6 to 9
|
|
||||||
move 1 from 5 to 6
|
|
||||||
move 1 from 6 to 2
|
|
||||||
move 1 from 1 to 7
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 1 from 1 to 2
|
|
||||||
move 3 from 7 to 2
|
|
||||||
move 2 from 1 to 4
|
|
||||||
move 8 from 4 to 5
|
|
||||||
move 22 from 8 to 1
|
|
||||||
move 1 from 8 to 1
|
|
||||||
move 13 from 4 to 1
|
|
||||||
move 1 from 8 to 5
|
|
||||||
move 3 from 3 to 1
|
|
||||||
move 1 from 2 to 7
|
|
||||||
move 38 from 1 to 6
|
|
||||||
move 27 from 6 to 1
|
|
||||||
move 2 from 2 to 9
|
|
||||||
move 3 from 9 to 8
|
|
||||||
move 2 from 8 to 6
|
|
||||||
move 1 from 8 to 3
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 1 from 3 to 6
|
|
||||||
move 1 from 2 to 3
|
|
||||||
move 1 from 7 to 6
|
|
||||||
move 7 from 6 to 3
|
|
||||||
move 20 from 1 to 4
|
|
||||||
move 6 from 1 to 6
|
|
||||||
move 17 from 4 to 7
|
|
||||||
move 3 from 6 to 5
|
|
||||||
move 14 from 7 to 9
|
|
||||||
move 8 from 5 to 7
|
|
||||||
move 3 from 1 to 6
|
|
||||||
move 3 from 3 to 1
|
|
||||||
move 2 from 4 to 1
|
|
||||||
move 4 from 5 to 1
|
|
||||||
move 9 from 6 to 2
|
|
||||||
move 3 from 6 to 4
|
|
||||||
move 4 from 7 to 8
|
|
||||||
move 4 from 1 to 6
|
|
||||||
move 2 from 3 to 1
|
|
||||||
move 6 from 6 to 7
|
|
||||||
move 4 from 8 to 7
|
|
||||||
move 4 from 2 to 1
|
|
||||||
move 4 from 2 to 3
|
|
||||||
move 4 from 9 to 5
|
|
||||||
move 8 from 9 to 5
|
|
||||||
move 1 from 9 to 5
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 16 from 7 to 2
|
|
||||||
move 10 from 2 to 9
|
|
||||||
move 11 from 9 to 8
|
|
||||||
move 4 from 3 to 5
|
|
||||||
move 3 from 1 to 4
|
|
||||||
move 13 from 5 to 7
|
|
||||||
move 10 from 8 to 5
|
|
||||||
move 2 from 1 to 5
|
|
||||||
move 11 from 7 to 4
|
|
||||||
move 2 from 3 to 6
|
|
||||||
move 3 from 7 to 6
|
|
||||||
move 1 from 3 to 2
|
|
||||||
move 1 from 1 to 8
|
|
||||||
move 2 from 8 to 4
|
|
||||||
move 3 from 1 to 2
|
|
||||||
move 4 from 6 to 1
|
|
||||||
move 7 from 1 to 9
|
|
||||||
move 1 from 6 to 7
|
|
||||||
move 2 from 5 to 8
|
|
||||||
move 1 from 2 to 9
|
|
||||||
move 1 from 7 to 8
|
|
||||||
move 5 from 5 to 8
|
|
||||||
move 1 from 2 to 3
|
|
||||||
move 4 from 2 to 5
|
|
||||||
move 17 from 4 to 1
|
|
||||||
move 10 from 5 to 9
|
|
||||||
move 2 from 4 to 2
|
|
||||||
move 2 from 4 to 1
|
|
||||||
move 1 from 4 to 9
|
|
||||||
move 1 from 3 to 7
|
|
||||||
move 1 from 7 to 8
|
|
||||||
move 12 from 9 to 2
|
|
||||||
move 1 from 2 to 4
|
|
||||||
move 1 from 4 to 1
|
|
||||||
move 1 from 1 to 9
|
|
||||||
move 1 from 8 to 1
|
|
||||||
move 8 from 8 to 3
|
|
||||||
move 2 from 5 to 1
|
|
||||||
move 3 from 1 to 9
|
|
||||||
move 1 from 2 to 6
|
|
||||||
move 4 from 3 to 7
|
|
||||||
move 1 from 7 to 6
|
|
||||||
move 10 from 9 to 2
|
|
||||||
move 1 from 5 to 9
|
|
||||||
move 1 from 9 to 3
|
|
||||||
move 17 from 1 to 6
|
|
||||||
move 2 from 1 to 2
|
|
||||||
move 11 from 6 to 7
|
|
||||||
move 2 from 2 to 9
|
|
||||||
move 2 from 9 to 5
|
|
||||||
move 12 from 7 to 9
|
|
||||||
move 20 from 2 to 7
|
|
||||||
move 5 from 9 to 5
|
|
||||||
move 21 from 7 to 1
|
|
||||||
move 2 from 6 to 4
|
|
||||||
move 11 from 1 to 4
|
|
||||||
move 5 from 4 to 6
|
|
||||||
move 1 from 7 to 8
|
|
||||||
move 5 from 9 to 3
|
|
||||||
move 5 from 2 to 8
|
|
||||||
move 3 from 9 to 3
|
|
||||||
move 2 from 8 to 7
|
|
||||||
move 2 from 1 to 7
|
|
||||||
move 10 from 6 to 3
|
|
||||||
move 1 from 2 to 6
|
|
||||||
move 2 from 8 to 5
|
|
||||||
move 1 from 6 to 5
|
|
||||||
move 2 from 4 to 9
|
|
||||||
move 1 from 4 to 5
|
|
||||||
move 8 from 1 to 6
|
|
||||||
move 4 from 4 to 8
|
|
||||||
move 6 from 8 to 4
|
|
||||||
move 21 from 3 to 9
|
|
||||||
move 5 from 9 to 2
|
|
||||||
move 4 from 7 to 9
|
|
||||||
move 22 from 9 to 3
|
|
||||||
move 9 from 6 to 4
|
|
||||||
move 2 from 2 to 6
|
|
||||||
move 2 from 2 to 1
|
|
||||||
move 2 from 5 to 7
|
|
||||||
move 7 from 5 to 4
|
|
||||||
move 22 from 4 to 2
|
|
||||||
move 2 from 5 to 4
|
|
||||||
move 16 from 2 to 5
|
|
||||||
move 2 from 6 to 2
|
|
||||||
move 13 from 3 to 4
|
|
||||||
move 5 from 5 to 7
|
|
||||||
move 15 from 4 to 7
|
|
||||||
move 3 from 2 to 3
|
|
||||||
move 3 from 2 to 5
|
|
||||||
move 1 from 1 to 2
|
|
||||||
move 1 from 2 to 4
|
|
||||||
move 6 from 5 to 9
|
|
||||||
move 4 from 3 to 6
|
|
||||||
move 2 from 5 to 9
|
|
||||||
move 1 from 2 to 7
|
|
||||||
move 1 from 1 to 9
|
|
||||||
move 2 from 4 to 5
|
|
||||||
move 19 from 7 to 8
|
|
||||||
move 1 from 6 to 5
|
|
||||||
move 1 from 5 to 1
|
|
||||||
move 1 from 9 to 4
|
|
||||||
move 5 from 8 to 1
|
|
||||||
move 3 from 8 to 1
|
|
||||||
move 7 from 5 to 6
|
|
||||||
move 3 from 7 to 1
|
|
||||||
move 1 from 2 to 5
|
|
||||||
move 4 from 9 to 8
|
|
||||||
move 2 from 5 to 6
|
|
||||||
move 10 from 1 to 4
|
|
||||||
move 1 from 7 to 2
|
|
||||||
move 6 from 3 to 4
|
|
||||||
move 9 from 4 to 3
|
|
||||||
move 2 from 2 to 8
|
|
||||||
move 2 from 9 to 5
|
|
||||||
move 5 from 8 to 3
|
|
||||||
move 1 from 1 to 5
|
|
||||||
move 2 from 5 to 6
|
|
||||||
move 1 from 1 to 7
|
|
||||||
move 2 from 9 to 7
|
|
||||||
move 8 from 4 to 7
|
|
||||||
move 3 from 3 to 9
|
|
||||||
move 4 from 6 to 3
|
|
||||||
move 1 from 5 to 3
|
|
||||||
move 1 from 7 to 2
|
|
||||||
move 1 from 2 to 1
|
|
||||||
move 1 from 6 to 5
|
|
||||||
move 1 from 5 to 2
|
|
||||||
move 10 from 7 to 4
|
|
||||||
move 10 from 4 to 1
|
|
||||||
move 10 from 1 to 8
|
|
||||||
move 1 from 9 to 6
|
|
||||||
move 1 from 1 to 4
|
|
||||||
move 11 from 8 to 1
|
|
||||||
move 2 from 9 to 5
|
|
||||||
move 5 from 6 to 3
|
|
||||||
move 1 from 3 to 8
|
|
||||||
move 4 from 1 to 3
|
|
||||||
move 5 from 3 to 8
|
|
||||||
move 1 from 4 to 7
|
|
||||||
move 1 from 7 to 2
|
|
||||||
move 13 from 3 to 5
|
|
||||||
move 2 from 2 to 1
|
|
||||||
move 4 from 3 to 1
|
|
||||||
move 4 from 5 to 6
|
|
||||||
move 3 from 6 to 2
|
|
||||||
move 4 from 5 to 4
|
|
||||||
move 8 from 8 to 7
|
|
||||||
move 1 from 3 to 9
|
|
|
@ -1,102 +0,0 @@
|
||||||
use std::collections::VecDeque;
|
|
||||||
|
|
||||||
static INPUT: &str = include_str!("input.txt");
|
|
||||||
|
|
||||||
type Instruction = (usize, usize, usize);
|
|
||||||
|
|
||||||
fn parse_input(s: &str) -> (Vec<VecDeque<char>>, Vec<Instruction>) {
|
|
||||||
let mut initial: Vec<VecDeque<char>> = vec![];
|
|
||||||
let mut instructions = vec![];
|
|
||||||
let mut input = s.lines();
|
|
||||||
for line in input.by_ref() {
|
|
||||||
if line.is_empty() {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
initial.push(line.chars().collect());
|
|
||||||
}
|
|
||||||
initial.reverse();
|
|
||||||
initial.remove(0);
|
|
||||||
let num_columns = (initial[0].len() + 1) / 4;
|
|
||||||
let mut finals = vec![VecDeque::new(); num_columns];
|
|
||||||
for line in initial {
|
|
||||||
for (i, tower) in finals.iter_mut().enumerate().take(num_columns) {
|
|
||||||
let ind = (i * 4) + 1;
|
|
||||||
match line[ind] {
|
|
||||||
' ' => continue,
|
|
||||||
_ => tower.push_front(line[ind]),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for line in input {
|
|
||||||
let parsed_line = parse_instruction(line);
|
|
||||||
instructions.push(parsed_line);
|
|
||||||
}
|
|
||||||
(finals, instructions)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn parse_instruction(s: &str) -> Instruction {
|
|
||||||
let binding = String::from(s)
|
|
||||||
.split(|c: char| c == ' ' || c.is_alphabetic())
|
|
||||||
.filter(|v| !v.is_empty())
|
|
||||||
.map(|c| c.parse().expect("not a number!"))
|
|
||||||
.collect::<Vec<usize>>();
|
|
||||||
let mut instructions = binding.iter();
|
|
||||||
match (
|
|
||||||
instructions.next(),
|
|
||||||
instructions.next(),
|
|
||||||
instructions.next(),
|
|
||||||
) {
|
|
||||||
(Some(a), Some(b), Some(c)) => (*a, *b, *c),
|
|
||||||
_ => panic!("error parsing input"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn execute_instructions_900(
|
|
||||||
instructions: Vec<Instruction>,
|
|
||||||
mut initial: Vec<VecDeque<char>>,
|
|
||||||
) -> Vec<VecDeque<char>> {
|
|
||||||
for (num, src, dst) in instructions {
|
|
||||||
for _i in 0..num {
|
|
||||||
match initial[src - 1].pop_front() {
|
|
||||||
Some(a) => initial[dst - 1].push_front(a),
|
|
||||||
_ => panic!("attempted to pop from empty stack"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
initial
|
|
||||||
}
|
|
||||||
|
|
||||||
fn execute_instructions_9001(
|
|
||||||
instructions: Vec<Instruction>,
|
|
||||||
mut initial: Vec<VecDeque<char>>,
|
|
||||||
) -> Vec<VecDeque<char>> {
|
|
||||||
for (num, src, dst) in instructions {
|
|
||||||
for i in 0..num {
|
|
||||||
match initial[src - 1].pop_front() {
|
|
||||||
Some(a) => initial[dst - 1].insert(i, a),
|
|
||||||
_ => panic!("attempted to pop from empty stack"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
initial
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn solution_a() -> String {
|
|
||||||
let (initial, instructions) = parse_input(INPUT);
|
|
||||||
let initial = execute_instructions_900(instructions, initial);
|
|
||||||
let mut result = String::new();
|
|
||||||
for tower in initial {
|
|
||||||
result.push(tower[0]);
|
|
||||||
}
|
|
||||||
result
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn solution_b() -> String {
|
|
||||||
let (initial, instructions) = parse_input(INPUT);
|
|
||||||
let initial = execute_instructions_9001(instructions, initial);
|
|
||||||
let mut result = String::new();
|
|
||||||
for tower in initial {
|
|
||||||
result.push(tower[0]);
|
|
||||||
}
|
|
||||||
result
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
--- Day 6: Tuning Trouble ---
|
|
||||||
|
|
||||||
The preparations are finally complete; you and the Elves leave camp on foot and begin to make your way toward the star fruit grove.
|
|
||||||
|
|
||||||
As you move through the dense undergrowth, one of the Elves gives you a handheld device. He says that it has many fancy features, but the most important one to set up right now is the communication system.
|
|
||||||
|
|
||||||
However, because he's heard you have significant experience dealing with signal-based systems, he convinced the other Elves that it would be okay to give you their one malfunctioning device - surely you'll have no problem fixing it.
|
|
||||||
|
|
||||||
As if inspired by comedic timing, the device emits a few colorful sparks.
|
|
||||||
|
|
||||||
To be able to communicate with the Elves, the device needs to lock on to their signal. The signal is a series of seemingly-random characters that the device receives one at a time.
|
|
||||||
|
|
||||||
To fix the communication system, you need to add a subroutine to the device that detects a start-of-packet marker in the datastream. In the protocol being used by the Elves, the start of a packet is indicated by a sequence of four characters that are all different.
|
|
||||||
|
|
||||||
The device will send your subroutine a datastream buffer (your puzzle input); your subroutine needs to identify the first position where the four most recently received characters were all different. Specifically, it needs to report the number of characters from the beginning of the buffer to the end of the first such four-character marker.
|
|
||||||
|
|
||||||
For example, suppose you receive the following datastream buffer:
|
|
||||||
|
|
||||||
mjqjpqmgbljsphdztnvjfqwrcgsmlb
|
|
||||||
|
|
||||||
After the first three characters (mjq) have been received, there haven't been enough characters received yet to find the marker. The first time a marker could occur is after the fourth character is received, making the most recent four characters mjqj. Because j is repeated, this isn't a marker.
|
|
||||||
|
|
||||||
The first time a marker appears is after the seventh character arrives. Once it does, the last four characters received are jpqm, which are all different. In this case, your subroutine should report the value 7, because the first start-of-packet marker is complete after 7 characters have been processed.
|
|
||||||
|
|
||||||
Here are a few more examples:
|
|
||||||
|
|
||||||
bvwbjplbgvbhsrlpgdmjqwftvncz: first marker after character 5
|
|
||||||
nppdvjthqldpwncqszvftbrmjlhg: first marker after character 6
|
|
||||||
nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg: first marker after character 10
|
|
||||||
zcfzfwzzqfrljwzlrfnpqdbhtmscgvjw: first marker after character 11
|
|
||||||
|
|
||||||
How many characters need to be processed before the first start-of-packet marker is detected?
|
|
||||||
|
|
||||||
Your puzzle answer was 1816.
|
|
||||||
--- Part Two ---
|
|
||||||
|
|
||||||
Your device's communication system is correctly detecting packets, but still isn't working. It looks like it also needs to look for messages.
|
|
||||||
|
|
||||||
A start-of-message marker is just like a start-of-packet marker, except it consists of 14 distinct characters rather than 4.
|
|
||||||
|
|
||||||
Here are the first positions of start-of-message markers for all of the above examples:
|
|
||||||
|
|
||||||
mjqjpqmgbljsphdztnvjfqwrcgsmlb: first marker after character 19
|
|
||||||
bvwbjplbgvbhsrlpgdmjqwftvncz: first marker after character 23
|
|
||||||
nppdvjthqldpwncqszvftbrmjlhg: first marker after character 23
|
|
||||||
nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg: first marker after character 29
|
|
||||||
zcfzfwzzqfrljwzlrfnpqdbhtmscgvjw: first marker after character 26
|
|
||||||
|
|
||||||
How many characters need to be processed before the first start-of-message marker is detected?
|
|
||||||
|
|
||||||
Your puzzle answer was 2625.
|
|
||||||
|
|
||||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
|
|
@ -1 +0,0 @@
|
||||||
mnlnvlljqqccznnjtjljbllrtllwwpmmhjjbbzppnndmmsppdqqwvvstvssgmsggmlmttnvvfbbdsssnzzbssjrsjjpmpvmmcjjwsssndsslwsswtwnwrrslshhvzzsppffmpfmmfvfpfpsssqpqzpqqcjcjnjcnnzbzjzpzbpbnbwbcctvvhgvgsvvpwwvjjvqjjjdqqrmrmqmsqszqsqpsqslsddhbhcbhbchcvvjvjcjnccdbcdcrddldblbffhvffpvpzpvvmvfmmwhwqhqvhqhmmpdmmlbmbgmbbrqqpmqqcvcmvvcncllptltvtdtbbqzzcggjgsjjvjsvvgmgffqhqqgpptspsffvdvbbhqhzzllvvjbvvbpppggfpgptgtvvzdvdzdgzgccmmphpmhppldlnlpnnhghhrrgwrwssnllmpllbvbvqvtvhtvvmnvvpgvgfvggtztpthhcfhfqfhhnhtnhhljhjppqjjffgjggrwrjjhphzhtztggwswnwzzvbzzmmtrtqtjqttwlwmmmmnddmnddwvvcllgrgfgzznwnsswjjhwwspsbbvzzqvzvbvcvmmtltnlnfnfnwwsvwwpswppjhjdhhmbbblfbfwffwvvjgghwhzhjzzrttwhwjhjchjhggdrgdgmmsjsfstftvtmtctggcwgcgzccgzgsgrgmmjhhqzzrmrttgtgfgcffvsfvvslsvvpqvvnjnrrwdwcwcnnhllwpwdpwdpdqqtwtftdftddppncpnccllqqrffpssgvsvtvmvssrbrhbbzggtssdsvddqfdfjfhjhdjhhncnddfpdfdmmrddncnvcnvccgvvhzvzwztwzwtzwtwqttrlrvrddztzrzcccgmmqgqjgqjgjqqspqqpjppbggchcqcpqqgbgdbbspbbrbhrhzhqhrqhhhtbhhvshspsvsggjdjwjwvjvdvwddjggmrrbnrrztthlllhlclbclbbhpbhphjhccdwccdbbjrbjjmrjrhhnlnjllltwltlmmlqlnqntqnntsnsqqvtvwvgwvwnncgcdctddnttfjfqfttrhrjhjqqcnnsmnmgmqgmgbblcctntrntnccnvvmpmjjvfjfrrbpbttsbttvnttmnnjdnndnzntnrnwrwcctllvhvqhhddmzztppphghphzzglzlnnfccrfffvvhllpspwssstwstsvttcrtccfssbccdjdqdfqddrbrqbbtllmmsfmfcmmzwzpznpnttjgtgbbdtdvdwwpmphpprsrjrbrqbqwwljlslrlrhhpchpcprcrtcrcfcfssndsspddcjjjfmfqfggmssnhsnhnpncnfnmffdrdjdhjjrgjrjgjqgjqqlmlljffbcfcrrrzwwftwtrrpgpprqqmrmhmwhwmmcrrhqrqwqppwjwggpdpgpvgvzvttqlljhhbvbhblhhcsssvmsmppcvpvrvzvbvtbtssplpgptgtnthhvwhvwwfvvfwwmtwmwfmfgmgnmnllgsgmsgswwhqhhhzqhhfwwnttmfmrrfnnpbpssvbsshqhqvhqqbmbpmbmqqjtjqjvjtjjhtttpzphpqqwqfqttqqhfhbfhfwwcpcpssdvvzhzwwqddjzdjdldlggvnvlnlbljlqjjmcczbccznnlnslswlwplpttvrvllfwflftllhclldhlhddbvvpvzpvpmmrccvgvdvqqjcqqwvvnjjlbbjwjrjhhlzhlhttljlcjjsnsgngrnntzzbsbmbsbrbdrdppjrjlrrjljqlqhqqnqsgdvhpgdhmnslqtjclmcfzrmgmlfnjbzznfgfprvwprwdbcgfcclmspgnzpbshwjbqvhzhrhswjzbfvnmcjtfvqbwmjpvfvctpmwsspdbtvfhfdfzjdpqnvslgmdvrnflzwzcnzmvzsvznwhpwtjwnqdgrrttmmdwzbbnwtllpbffrgtpjjjwltqrcbqcttdwnfjpmhdsbbpqmstjqchgjvfrmrbgqrlstnbdnzzzbzbsmsnnsssswmqhcbswtjhmcgnwmcclhzjqjzqcpbzgdzjgqzpqbmvvhtcznfrhdndswfvfhtfpdpszpjqrlwfdscvcngftwqmfttjtjrlbgcwvcjwsstqmcblmjzsgtgrqnqqvhzhvsphjmbcpfcznlcqldcvhlsvggbjngmhspwwqhlwstslvwmmbwqdmrgdvvnlstmjllhzscrhzjtmnsjfbndnlmzqbzgdgbcqchnbvwsftjtznnbsnvsgzpdzdqznjsslrlfnccdhwsljhczggvmgqswjltmrqqmwtbzmtdzhpjcvmwsscsdzpfnwlcrrdgzqqdmgwdlzvvvjcqsgpcwvrdnrstpcmgfjnjffbfmgzjthhllzrlsjtnqfppltbrlnqnjvqlvtpqvsbfgmmlcdzhgmzzqjwtqtzmpwwddbqrqnfzzpsjglsjddsslwwlrttzfzplmwsswlnvrvwwcgddjwcmvsjjbfgcfjmthfbpmcwjptchhnsmzttjqnwzdljffghhqdcwzwgbvfsmwqdbtblphdgcmbhprtbccjbzqrpvjdbnsmlwfntvjgptnshzmddwbhgwsnfrjbpqqwlsfdpnmmnnwhdmhzvjcmddbdnjzfzvffbgdqgwbggprcrbzwhvtzzgbhhcscrlmfgztfswjbsnwsmdfwlntwjzvlwhvlrfzszllmflmrsrcfnncvszvgdmmnvgrqnjhljcnrrhpdhffwmrsqfnbcpfdmmgppwjbjrwdfmpcrbznrjnbmssszhnlbpgmlczhhcdtgjqcbqrvzcbpgrftfhzdqthhspwnqqswntlpcmmqtcszngpggqvfjnmnprhdfjsngwrncjcmqdmjhpdlfnshpdlnlfpcnprwjgdvwwbvhvsbrfjtqsqjnvcpfdsrnfwmrrbtcvcqzflhdlbpcthzthdjzsrvwgbhjvhbtrngthfrszlvrbtnscsqlblcwlngslspcrhqzzdlzcdbhqdhthlpmdrntbhnqtwtzwpndbgphpsllbvgqjtmszdvjpgttzcmbwgrgdwmsbfgvgbbcmsnhvmnsbcsthsdwdqtghpdclfbglbdjgnnnwhmzzvnhbmgfbmvqwvwqhdswgtzslspmbmznnwdmjbzbddhzchtdzdzgwtlmlpmwrqvghpfwhvfjrtvmjwgjjnwdwnpdcqjdmcctjfcrdgpvczvnhlrbfmqgnrhmdwsrmmpqhvwgqgbqccpznpjfldwpntnvzgdfzljmtqwvfnrdsjsqgbvzjsczwwjggqtrpvwgqggwwhqggtgqfjmzsmjvdhdwqggbgnftpqqqlsfpflwrdpjwnhfdpchcgntjshgtwnwrnpsvwmplvqcltbgrcpflpgzbqfclghfnwjchnbgjnplgldmphdplvjrnrtzcmlftprsnmrjmnffpqjlvqlztbwprjwprrmmgzhjgdnhbfdrwjtvsvnbqhtfhbqgdrvcwlwfdbbcthgvttpvrwrqmpmrmvgpjzwlpvbqcvgccpgfddjbwhrvgqmjqzwgghllrtrblcpbttmcrgjsftlqhjfvqnbhmhbhngwnfqtgdttstzvmstrqcpfjrdgtsdbqqccqvbhpwhnpmpqgntfqszndjrmfhlqjqjbqvjtlfmrnnzzrtqlzzhjfqmmsmzvzrcplmfjpcmpfmpzbsbrmbnbnjqwjcfwnnwwrwzvvrsvhvrwnhlmwqjdztqthcwnwrlbjdflfsbplbwfmzqqnpwvzjbcfdgztpwttlrvhlfzzsfltpqwcpnzlsqgvwnqfvgclrfvssfcfmfvvjsndrhqdbrqfggfhjbvdvvmgpglqzwgjdmqtscjpfhgsbshghtmftrrhznttpzrzcsmrrvzdjmwtmbcbpqbsdmqzqdzrncwzmptltvdphsltfrhbbrdzbnbsqdhfvrgvmbgfvwblsjvfphlpzfvsllwnqjmbhngzzslcdmdzfgrgscbzggrzmbmwlzbnpzcvsbsfgdpnwzljsf
|
|
|
@ -1,37 +0,0 @@
|
||||||
use std::collections::HashSet;
|
|
||||||
use std::collections::VecDeque;
|
|
||||||
|
|
||||||
static INPUT: &str = include_str!("input.txt");
|
|
||||||
|
|
||||||
fn solve(input: &str, n: usize) -> i32 {
|
|
||||||
let mut position = 1;
|
|
||||||
let mut buffer = input.chars().take(n).collect::<VecDeque<char>>();
|
|
||||||
let mut datastream = input.chars();
|
|
||||||
|
|
||||||
loop {
|
|
||||||
let mut uniqs = HashSet::new();
|
|
||||||
let pointer = datastream.next();
|
|
||||||
match pointer {
|
|
||||||
None => panic!("no header found"),
|
|
||||||
Some(c) => {
|
|
||||||
buffer.pop_front();
|
|
||||||
buffer.push_back(c);
|
|
||||||
let result = buffer.clone().into_iter().all(|x| uniqs.insert(x));
|
|
||||||
if result {
|
|
||||||
return position;
|
|
||||||
} else {
|
|
||||||
position += 1;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn solution_a() -> i32 {
|
|
||||||
solve(INPUT, 4)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn solution_b() -> i32 {
|
|
||||||
solve(INPUT, 14)
|
|
||||||
}
|
|
Loading…
Reference in a new issue