The TransCompilator

Solved LeetCode program · 912 of 1,000

#1266 · Minimum Time Visiting All Points

Easy Array chunk-19.md

Original English source

The xs is a list of 1, 3, and -1. The ys is a list of 1, 4, and 0. The last is the last position of xs. The total is 0.
For every spot from 1 to last.
The east is item spot of xs minus item (spot minus 1) of xs. The north is item spot of ys minus item (spot minus 1) of ys. Set east to the absolute value of east. Set north to the absolute value of north. The stride is the larger of east and north. Add stride to total.

Show total.

Open in Playground Browse all 1,000 problems

Expected stdout

7