Min Steps in Infinite Grid
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.
NOTE: This question is intentionally left slightly vague. Clarify the question by trying out a few cases in the “See Expected Output” section.
Input Format
Given two integer arrays A and B, where A[i] is x coordinate and B[i] is y coordinate of ith point respectively. Output Format
Return an Integer, i.e minimum number of steps. Example Input
Input 1:
Example Output Output 1:
Example Explanation Explanation 1:
Last updated