The TransCompilator

Solved LeetCode program · 177 of 1,000

#0204 · Count Primes

Medium Array chunk-04.md

Original English source

The flags is a list of 10 zeros.
For every spot from 0 to 9.
Set item spot of flags to 1.

Set item 0 of flags to 0. Set item 1 of flags to 0.
For every base from 2 to 9.
If item base of flags is 1.
The multiple is base times base.
Repeat while multiple is less than 10.
Set item multiple of flags to 0. Increase multiple by base.

The count is 0.
For every spot from 2 to 9.
If item spot of flags is 1, add 1 to count.

Show count.

Open in Playground Browse all 1,000 problems

Expected stdout

4