Ad
  • Default User Avatar

    .abs() is not necessary in last line since min2 may be greater than max1 but then max2 will defenitely also be greater than min1 and the max expression will return (max2-min1) which is positive (or vice versa).
    Still i like this solution best, well done!