The TransCompilator

Solved LeetCode program · 788 of 1,000

#1024 · Video Stitching

Medium Array chunk-16.md

Original English source

The starts is a list of 0, 4, 8, 1, 1, and 5. The ends is a list of 2, 6, 10, 9, 5, and 9. The time is 10. The table is a list of 11 zeros. Set item 0 of table to 0.
For every moment from 1 to 10.
Set item moment of table to 1000000.

For every moment from 1 to 10.
For every clip from 0 to 5.
The start is item clip of starts. The finish is item clip of ends.
If start is less than moment and moment is at most finish.
The prior is item start of table. If prior plus 1 is less than item moment of table, set item moment of table to prior plus 1.

Show item 10 of table.

Open in Playground Browse all 1,000 problems

Expected stdout

3