Official algorithmic problem description and constraints.
There is a clock labeled with the numbers 1 through 12 in clockwise order, as shown below.
In this example, (π,π,π,π)=(2,9,10,6), and the strings intersect.
Alice and Bob have four distinct integers π, π, π, π not more than 12. Alice ties a red string connecting π and π, and Bob ties a blue string connecting π and π. Do the strings intersect? (The strings are straight line segments.)
Detailed video explanations, mathematical intuition, and clean C++ implementation code.