hackerrank circle-city

you can obtain the problem statement from here. [problem]

the problem is simply to find out how many lattice points(ie (int, int)) on a circle with radius in a 2D plane.

https://gist.github.com/8a971b296e9715cfff2b

but i observed that the sqrt(x).is_integer() is slower than x*x in squares_of_integers_upto_2000000000

https://gist.github.com/36a010f635651da81b11

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s