summaryrefslogtreecommitdiffstats
path: root/2015/rs/code/five/src
diff options
context:
space:
mode:
Diffstat (limited to '2015/rs/code/five/src')
-rw-r--r--2015/rs/code/five/src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/2015/rs/code/five/src/main.rs b/2015/rs/code/five/src/main.rs
index eeafd42..3c4872c 100644
--- a/2015/rs/code/five/src/main.rs
+++ b/2015/rs/code/five/src/main.rs
@@ -1,4 +1,4 @@
-static INPUT: &'static str = include_str!("input.txt");
+static INPUT: &str = include_str!("input.txt");
fn main() {
let valueified = INPUT.split('\n').filter(|s| !s.is_empty());
@@ -34,7 +34,7 @@ fn main() {
let mut flag2 = false;
for c in s {
- if !flag1 && (lc != c || (lc == c && (llc != lc || !pushed))) && dupeslist.contains(&(lc, c)) { flag1 = true; }
+ if !flag1 && (!pushed || llc != lc || lc != c) && dupeslist.contains(&(lc, c)) { flag1 = true; }
if !flag1 && !dupeslist.contains(&(lc, c)) { dupeslist.push((lc, c)); pushed = true; } else { pushed = false; }
if c == llc { flag2 = true; }