prime sieve

✓ Passing This code compiles and runs correctly.

Code

input.k

Actual

78498

Expected output

78498

Flows

flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: sieve, size: 1000001, source: composite: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: acc, source: n: 0[i64])
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: sieve[0].composite: 1)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: sieve[1].composite: 1)
flow ~for click a branch to expand · @labels scroll to their anchor
for (2..1001)
flow ~sweep click a branch to expand · @labels scroll to their anchor
sweep (expr: sieve)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "{{ acc.n:d }}")

Test Configuration

MUST_RUN