## Google Interview Question

SDE-2s**Country:**United States

Also, we can find out what point groups can not mutually create a circle. How? Simple, any 3 points on a plane can be made into a circle, unless all 3 of them form a line.

It is O(n^2) to check all points to find out all lines, at most.

So, we would have point groups which can not be used as circle.

That automatically should reduce a lot of points comparison.

They, might be possibly more optimisations, but am thinking still. Hence a comment, not an answer.

observation:

- plarion October 27, 2019after you calculate a circle - find all points on the circle (o(n))

since a triplet form only one circle - so all combination of point on that circle form the same circle.

so there is no need to re-calculate a circle with them.

storing them in a hash and skipping them in the future will reduce run-time.

you will still go over all triplets (o(n^3)) but you will call the method getCircle(...) much fewer times.