Skip to content

Commit

Permalink
Oh good, Python's b-strings work
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 23, 2024
1 parent dd1139e commit 5fd4f62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/src/p0034.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn p0034() -> i128 {
for x in 10..100000 {
let sum = x.to_string()
.bytes()
.fold(0, |a, b| a + factorial::<u32>(b - u8::from('0')));
.fold(0, |a, b| a + factorial::<u32>(b - b'0'));
if sum == x {
answer += x;
}
Expand Down

0 comments on commit 5fd4f62

Please sign in to comment.