Hi, can anyone please explain what is the significance of Pythagorean theorem in the question and what exactly is it being used to find out?
It’s used to find the euclidean distance between two points. In this case, it’s between the point you want to visit and the centers of the circles. If the distance is smaller than the radius, then your point is inside the circle and you cannot go through this path.
They found the distance between the current point and all circle centers using Euclidean distance if the distance is less than the radius then the current point is in the circle.