The TransCompilator

Solved LeetCode program · 798 of 1,000

#1035 · Uncrossed Lines

Medium Array chunk-16.md

Original English source

The first is a list of 1, 4, and 2. The second is a list of 1, 2, and 4. The width is 3. The table is a list of 16 zeros.
For every left from 1 to 3.
For every right from 1 to 3.
The cell is left times 4 plus right. The above is left minus 1. The side is right minus 1. The here is item above of first. The there is item side of second. If here is there, The old is item (above times 4 plus side) of table, set item cell of table to old plus 1. The north is item (above times 4 plus right) of table. The west is item (left times 4 plus side) of table. The best is the larger of north and west. If here is not there, set item cell of table to best.

Show item 15 of table.

Open in Playground Browse all 1,000 problems

Expected stdout

2