1855. Maximum Distance Between a Pair of Values || JAVA || Easy Understanding
\nclass Solution {\n    public int maxDistance(int[] nums1, int[] nums2) {\n     int i=0,j=0,n=nums1.length,m=nums2.length;\n        int max=0;\n        while(i
```\nclass Solution {\n    public int maxDistance(int[] nums1, int[] nums2) {\n     int i=0,j=0,n=nums1.length,m=nums2.length;\n        int max=0;\n        while(i<n && j<m)\n        {\n            if(nums1[i]>nums2[j])\n                i++;\n            else\n            {\n                max=Math.max(max,j-i);\n                j++;\n            }\n        }\n        return max;\n    }\n}\n```\n
['Java']