Click here to see the full article post
@zestypanda Thanks for pointing it out. I have removed #3 approach.
@dimessi I've updated the description in the 3rd approach. Hope it'll be clear now.
@Ryanm In that case also, the distance calculation isn't max-min, but it is MAX(max-a, a[n-1]-min). Here a and a[n-1] belong to the next array being considered. Thus, the distance is always calculated among separate arrays only. You can see the illustration above which includes this case as well.
@RSLeet2017 Yes. I have updated the code. Thanks
seems to be a typo in #3 ?
a[n−1]−b and b[m-1]-b should be a[n−1]−b and b[m-1]-bb[m−1]−a
@venkat I have corrected it. Thanks.
@vinod23 3rd approach is awesome.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.