The TransCompilator

Solved LeetCode program · 881 of 1,000

#1207 · Unique Number of Occurrences

Easy Array chunk-18.md

Original English source

Keep a shared numbers holding 1, 2, 2, 1, 1, and 3.

Keep a shared distinct as an empty list of whole numbers. Keep a shared counts as an empty list of whole numbers. Keep a shared total of 0. Keep a shared known of 0.

To count from value (a whole number). Set total to 0. The last is the last position of numbers.
For every spot from 0 to last.
If item spot of numbers is value, add 1 to total.

To check from value (a whole number). Set known to 0. The last is the last position of distinct.
For every spot from 0 to last.
If item spot of distinct is value, set known to 1, stop.

For every spot from 0 to 5.
The value is item spot of numbers. Check from value.
If known is 0.
Count from value. Place value into distinct. Place total into counts.

The same is 0. The last is the last position of counts.
For every left from 0 to last.
For every right from left plus 1 to last.
If item left of counts is item right of counts, set same to 1.

If same is 0, show true, otherwise show false.

Open in Playground Browse all 1,000 problems

Expected stdout

true