C++ Easy solution
\nclass Solution {\npublic:\n    int maxDistance(vector<int>& nums1, vector<int>& nums2) {\n        int i = 0, j = 0, ans = 0;\n        while (i < nums1.size() 
```\nclass Solution {\npublic:\n    int maxDistance(vector<int>& nums1, vector<int>& nums2) {\n        int i = 0, j = 0, ans = 0;\n        while (i < nums1.size() && j < nums2.size())\n            if (nums1[i] > nums2[j])\n                i++;\n            else{\n                ans = max(ans, j - i);\n                j++;\n            }\n            return ans;\n        }\n    \n};\n```
[]