summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-12-06 22:50:59 +0100
committerSanto Cariotti <santo@dcariotti.me>2021-12-06 22:50:59 +0100
commit3e4ae4519f5c52f39cff2a05c0b7435a453bed70 (patch)
tree9942fb8ac1e50d0ece6866d21e9bcea98416b342
parent5f574cf344f579787f3ba6a65831a8e80532acbd (diff)
Fix day1
-rw-r--r--day1/src/main.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/day1/src/main.rs b/day1/src/main.rs
index ed6c56c..7e18b94 100644
--- a/day1/src/main.rs
+++ b/day1/src/main.rs
@@ -11,11 +11,7 @@ fn main() {
.collect::<Vec<i32>>();
let mut increasing: u16 = 0;
- for (index, _) in values.iter().enumerate() {
- if index == 0 {
- continue;
- }
-
+ for index in 1..values.len() {
if values[index - 1] < values[index] {
increasing += 1;
}