[JAVA] 3ms two pointer easy solution
\nclass Solution {\n    public int maxDistance(int[] nums1, int[] nums2) {\n      int i = 0, j = 0, res = 0;\n      while(i < nums1.length && j < nums2.length) 
```\nclass Solution {\n    public int maxDistance(int[] nums1, int[] nums2) {\n      int i = 0, j = 0, res = 0;\n      while(i < nums1.length && j < nums2.length) {\n        if(nums1[i] > nums2[j])\n          i ++;\n          \n        else \n          res = Math.max(res, j++ - i);\n      }\n      return res;\n    }\n}\n```\n# PLEASE UPVOTE IF IT WAS HELPFULL
['Two Pointers', 'Java']