The brief states "You may assume the parameter is positive", but one of the tests uses 0 as a parameter. Consider changing "positive" to "non-negative".
I am curious of this one, if it is ok to ask, how would someone here go about getting the roots of a number, possibly on paper the easiest way possible. For example how could I determine that the roots of 121 would in fact be 11?
Edit: Perhpas in python I could use sqrt() for that
Judging by the fact it hasn't been solved in 4 months and no feedback given to your comment, it seems that nobody really cares about those corner cases. :( Although they render a good portion of solutions plainly wrong.
There's also a really interesting one edge case: (2^26 + 1)^2 - 1. Solutions that test for fraction part of sqrt() to be zero will think it's a perfect square.
This comment is hidden because it contains spoiler information about the solution
The brief states "You may assume the parameter is positive", but one of the tests uses 0 as a parameter. Consider changing "positive" to "non-negative".
This comment is hidden because it contains spoiler information about the solution
чтобы найти корень числа в Питоне, нужно возвести его в степень 0.5, например 121**0.5
.sqrt(n); is what I'm using with javascript
'looks like you solved it'
'looks like you solved it'
There is still a typo in that sentence.
I am curious of this one, if it is ok to ask, how would someone here go about getting the roots of a number, possibly on paper the easiest way possible. For example how could I determine that the roots of 121 would in fact be 11?
Edit: Perhpas in python I could use sqrt() for that
ah i see thx
You can see other solutions and discuss your own in Solutions section.
This comment is hidden because it contains spoiler information about the solution
Judging by the fact it hasn't been solved in 4 months and no feedback given to your comment, it seems that nobody really cares about those corner cases. :( Although they render a good portion of solutions plainly wrong.
There's also a really interesting one edge case: (2^26 + 1)^2 - 1. Solutions that test for fraction part of sqrt() to be zero will think it's a perfect square.
This comment is hidden because it contains spoiler information about the solution
Loading more items...