Easy Java solution || 2 Pointer
Please UPVOTE if you like my solution!\n\n\nclass Solution {\n    public int maxDistance(int[] nums1, int[] nums2) {\n        int i = 0;\n        int j = 0;\n  
Please **UPVOTE** if you like my solution!\n\n```\nclass Solution {\n    public int maxDistance(int[] nums1, int[] nums2) {\n        int i = 0;\n        int j = 0;\n        int ans = 0;\n        while(i<nums1.length && j<nums2.length){\n            if(nums1[i] <= nums2[j]){\n                ans = Math.max(ans,j-i);\n                j++; \n            }\n            else{\n                i++;\n            }  \n            \n        }\n        return ans;\n    }\n}\n```
['Two Pointers', 'Java']