The TransCompilator

Solved LeetCode program · 761 of 1,000

#0997 · Find the Town Judge

Easy Array chunk-16.md

Original English source

The trust is a list of 1, 3, 2, and 3. The scores is a list of 4 zeros.
For every pair from 0 to 1.
The giver is item (pair times 2) of trust. The taker is item (pair times 2 plus 1) of trust. Decrease item giver of scores by 1. Increase item taker of scores by 1.

The judge is -1.
For every person from 1 to 3.
If item person of scores is 2, set judge to person.

Show judge.

Open in Playground Browse all 1,000 problems

Expected stdout

3