diff options
author | Justin Wernick <justin@worthe-it.co.za> | 2022-04-19 20:26:36 +0200 |
---|---|---|
committer | Justin Wernick <justin@worthe-it.co.za> | 2022-04-19 20:26:36 +0200 |
commit | 9892e3ebde304726903a1e5c358d05c2e343ea5e (patch) | |
tree | 404004f8d2131fa8d1e7524c6707a3ecdb0b44e0 /2019/src/main.rs | |
parent | 48a9be141afadaa24182781a2db58594cb2ce522 (diff) |
Refile for merging repos
Diffstat (limited to '2019/src/main.rs')
-rw-r--r-- | 2019/src/main.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/2019/src/main.rs b/2019/src/main.rs new file mode 100644 index 0000000..0c24a73 --- /dev/null +++ b/2019/src/main.rs @@ -0,0 +1,12 @@ +use std::io; +use std::io::prelude::*; + +fn main() { + let stdin = io::stdin(); + let answer = string_length_sum(stdin.lock().lines().map(|l| l.unwrap())); + dbg!(answer); +} + +fn string_length_sum(it: impl Iterator<Item = String>) -> usize { + it.map(|l| l.len()).sum() +} |