C++ binary search accepted solution #ACCEPTED😍😍
class Solution {\npublic:\n\n    int maxDistance(vector& nums1, vector& nums2) {\n        int ans = 0;\n        \n        int n = nums1.size();\n        int m =
class Solution {\npublic:\n\n    int maxDistance(vector<int>& nums1, vector<int>& nums2) {\n        int ans = 0;\n        \n        int n = nums1.size();\n        int m = nums2.size();\n        \n        for(int i = 0 ; i < n ; i++){\n            int low  = i;\n            int high = m - 1;\n            int value = i;\n            \n            while(low <= high){\n                int mid = (low + high) / 2;\n                \n                if(nums2[mid] >= nums1[i]){\n                    low = mid + 1;\n                    value = mid;\n                }else{\n                    high = mid - 1;\n                }\n            }\n            \n            ans = max(ans , value - i);\n        }\n        \n        return ans;\n    }\n};
['C', 'Binary Tree']