SIMPLE TWO-POINTER C++ SOLUTION
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:o(n+m)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:o(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n#define ll long long \nclass Solution {\npublic:\n    int maxDistance(vector<int>& nums1, vector<int>& nums2) {\n           int n = nums1.size();\n        int m = nums2.size();\n        int i=0;\n        int j =0; \n        int ans  = 0; \n           while(i < n && j < m){\n                 if(nums1[i] > nums2[j])\n                 i++;\n                 else{ // nums1[i] <= nums2[j]\n                     ans  = max(ans ,j - i);\n                    j++;\n            }\n        }\n            return ans;\n    }\n};\n```
['C++']