Skip to content

Commit

Permalink
usize
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Aug 30, 2024
1 parent d7ddd9f commit 8902854
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions rust/src/p0111.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ pub fn p0111() -> Answer {
for p in primes_until::<u64>(ten_10).filter(|x| *x > ten_9) {
let s = p.to_string();
for digit in 0..=9 {
let idx = digit as usize;
let count = s.bytes().filter(|b| *b == digit + b'0').count();
if count > current[digit] {
current[digit] = count;
subanswer[digit] = p;
} else if count == current[digit] {
subanswer[digit] += p;
if count > current[idx] {
current[idx] = count;
subanswer[idx] = p;
} else if count == current[idx] {
subanswer[idx] += p;
}

Check warning

Code scanning / clippy

if chain can be rewritten with match Warning

if chain can be rewritten with match

Check warning

Code scanning / clippy

if chain can be rewritten with match Warning

if chain can be rewritten with match
}
}
Expand Down

0 comments on commit 8902854

Please sign in to comment.