Skip to content

Instantly share code, notes, and snippets.

@sw1nn
Created December 22, 2017 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sw1nn/58309b98921aedba4cfcf06f76660a33 to your computer and use it in GitHub Desktop.
Save sw1nn/58309b98921aedba4cfcf06f76660a33 to your computer and use it in GitHub Desktop.
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