The TransCompilator

Solved LeetCode program · 905 of 1,000

#1252 · Cells with Odd Values in a Matrix

Easy Array chunk-19.md

Original English source

The rows is 2, while the columns is 3. The pairs is a list of 0, 1, 1, and 1. The size is rows times columns. The cells is a list of size zeros.
For every which from 0 to 1.
The rowspot is item (which times 2) of pairs. The colspot is item (which times 2 plus 1) of pairs.
For every column from 0 to columns minus 1.
Increase item (rowspot times columns plus column) of cells by 1.
For every band from 0 to rows minus 1.
Increase item (band times columns plus colspot) of cells by 1.

The odds is 0.
For each value in cells.
If value modulo 2 is 1, add 1 to odds.

Show odds.

Open in Playground Browse all 1,000 problems

Expected stdout

6