Created
December 22, 2017 12:10
-
-
Save sw1nn/58309b98921aedba4cfcf06f76660a33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn solution01() -> u64 { | |
INPUT.iter().fold(0, |a, line| { | |
let ref words: Vec<&str> = line.split_whitespace().collect(); | |
let uniq_words: BTreeSet<&&str> = words.into_iter().collect(); | |
if words.len() == uniq_words.len() { | |
a + 1 | |
} else { | |
a | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment