Simple java solution
```\nclass Solution {\n    public int maxDistance(int[] n1, int[] n2) {\n        int m=n1.length,n=n2.length,s=0;\n        for(int i=0,j=0;j<n&&in2[j])\n       
```\nclass Solution {\n    public int maxDistance(int[] n1, int[] n2) {\n        int m=n1.length,n=n2.length,s=0;\n        for(int i=0,j=0;j<n&&i<m;)\n        {\n            if(n1[i]>n2[j])\n                i++;\n            else\n                s=Math.max(s,j++-i);\n        }\n        return s;\n    }\n}
['Two Pointers', 'Java']