The TransCompilator

Solved LeetCode program · 904 of 1,000

#1250 · Check If It Is a Good Array

Hard Array chunk-19.md

Original English source

The values is a list of 12, 5, 7, and 23. Keep a shared common of 0.

To Reduce from first (a whole number) with second (a whole number). The low is the absolute value of first. The high is the absolute value of second. If high is 0, set common to low, return. Reduce from high with low modulo high.

Set common to item 0 of values.
For every spot from 1 to 3.
If common is 1, stop. Reduce from common with item spot of values.

If common is 1, show true, otherwise show false.

Open in Playground Browse all 1,000 problems

Expected stdout

true