We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
My approach is to calculate the power of the vertices with respect to circle.
If the points are inside print NO
If 2 ouside 1 inside print YES
If 1 ouside 2 inside print YES
If any 1 is on the circle print YES
If all the points are outside then solve the equation with the circle and check if the root lies between the end points of the line segment. I am getting an error.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Geometry
You are viewing a single comment's thread. Return to all comments →
My approach is to calculate the power of the vertices with respect to circle.
If the points are inside print NO If 2 ouside 1 inside print YES If 1 ouside 2 inside print YES If any 1 is on the circle print YES
If all the points are outside then solve the equation with the circle and check if the root lies between the end points of the line segment. I am getting an error.