powered by
This function checks if the two input intervals oferlap and outputs the corresponding pattern (up, down, or straight) based on that.
determine_uds(min1, max1, min2, max2)
A single character (one of "U", "D", "S") representing the pattern
the endpoints of the two intervals
determine_uds(10, 20, 15, 25) # overlap determine_uds(10, 20, 25, 35) # no overlap
Run the code above in your browser using DataLab