Arrays: Minimum Steps In Infinite Grid

Rohan Arora
Red Coder Publications
Mar 23, 2021

You are in an infinite 2D grid where you can move in any of the 8 directions. You are given a sequence of points and the order in which you need to cover the points. Give the minimum number of steps in which you can achieve it. You start from the first point.

Read complete question here — https://www.interviewbit.com/problems/min-steps-in-infinite-grid/

Asked in Directi.

Watch the complete video to understand the algorithm completely.

Min Steps in Infinite Grid Video Solution (Hindi Language)

Check out this easy code.

If you find this article helpful, give me a clap 👏.

Have any better solution? Share it in the comment section.

Check out Red Coder Publication for more solutions of InterviewBit, Leetcode, Codeforces, etc — Click here

Follow me for more articles 😃

--

--

Rohan Arora
Red Coder Publications

Competitive Programmer and Software Developer. Open for opportunities — rohanaroramedium@gmail.com