InterviewBit - Min steps in infinite grid  

by ne on 2021-09-22 under Algo

This problem is a property of InterviewBit (

Full details of the question, and if you want to try it out yourself, proceed to interviewbit :

Here's the implementation:


public class Solution {
    public int coverPoints(int[] A, int[] B) {
        int tot=0;
        for(int i=1;i<A.length;i++){
            for(int j=1;j<B.length;j++){
                int x=A[i];
                int y=B[j];
                int x0 = A[i-1];
                int y0 = B[j-1];
        return tot;

Happy Coding !