We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2760368 commit e6723fbCopy full SHA for e6723fb
src/day7.rs
@@ -41,11 +41,11 @@ pub fn part1(s: &str) -> u64 {
41
num *= 10;
42
num += (s[i] - b'0') as u64;
43
i += 1;
44
- if i >= s.len() || !s[i].is_ascii_digit() {
+ if !s[i].is_ascii_digit() {
45
v.push(num);
46
num = 0;
47
48
- if i >= s.len() || s[i - 1] == b'\n' {
+ if s[i - 1] == b'\n' {
49
break;
50
}
51
@@ -109,11 +109,11 @@ pub fn part2(s: &str) -> u64 {
109
110
111
112
113
114
115
116
117
118
119
0 commit comments