Class Test
CodeChefOpen on judge ↗
You have been given a task in your Class Test. You have been given two diagonally opposite coordinates which is sufficient enough to obtain the rectangle. Secondly you are given two random coordinates which would eventually make a line segment. You need to find the number of intersections the line segment makes with the rectangle. Intersecting any corner point will count two but if the line segmen
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start