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.
I'm pretty sure my solution isn't the intended solution, but in C I managed to solve this by 1) using the ray-crossing algorithm, and 2) severely optimizing the logic that happens for each pair of point and edge to not use any "ifs" (beyond the relevant one for the "for" loop) and minimize number of operations per loop.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Polygon
You are viewing a single comment's thread. Return to all comments →
I'm pretty sure my solution isn't the intended solution, but in C I managed to solve this by 1) using the ray-crossing algorithm, and 2) severely optimizing the logic that happens for each pair of point and edge to not use any "ifs" (beyond the relevant one for the "for" loop) and minimize number of operations per loop.