Skip to content

Commit

Permalink
Correct type to not truncate info or raise errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 18, 2024
1 parent 4ba5756 commit 58b1076
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust/src/p0008.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ pub fn p0008() -> u64 {
for i in 0..(string.len() - 13) {
let slice = &string[i..(i + 13)];
let mut prod: u64 = 1;
for c in slice.chars() {
prod *= (c - '0') as u64;
for c in slice.bytes() {
prod *= (c as u32 - '0' as u32) as u64;
}
if prod > answer {
answer = prod;
Expand Down

0 comments on commit 58b1076

Please sign in to comment.