C++ Easy and simple || 2 Pointer || O(N+M) time
\nint maxDistance(vector<int>& nums1, vector<int>& nums2) {\n    int n = nums1.size(), m = nums2.size(), i = 0, j = 0, total = 0;\n\n    while (i < n && j < m) 
```\nint maxDistance(vector<int>& nums1, vector<int>& nums2) {\n    int n = nums1.size(), m = nums2.size(), i = 0, j = 0, total = 0;\n\n    while (i < n && j < m) {\n        if (nums1[i] <= nums2[j]) {\n            total = max(total, j - i);\n            j++;\n        } else if (i < j) {\n            i++;\n        } else {\n            j++;\n        }\n    }\n    return total;\n}\n```
[]