Browse Source

further problem 7 optimizations

canon
Hazel Levine 1 year ago
parent
commit
4836d932c4
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/bin/prob7.rs

+ 1
- 1
src/bin/prob7.rs View File

@ -35,7 +35,7 @@ fn sieve(n: usize) -> Vec<u32> {
// assume that the resultant array generated by the sieve will contain the
// prime in question
fn compute(n: u32) -> u32 {
*sieve(estimate_size(n)).get((n - 1) as usize).unwrap()
sieve(estimate_size(n))[(n - 1) as usize]
}
fn main() {


Loading…
Cancel
Save