From 7420c8a9d80a0dc3160c64d63783259d8731259f Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Sun, 27 Dec 2015 20:53:48 -0800 Subject: [PATCH] Day 1.1 --- rust/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 83b29ae..378c1e1 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -17,7 +17,7 @@ impl Day for Day01 { fn solve(self) -> Result { let elevator = Elevator::new(self.input); - Ok(elevator.run().last().unwrap_or(0)) + Ok(1 + elevator.run().position(|f| f == -1).unwrap_or(0) as i32) } }