Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
同感
sqrt is calculated 2 times :(
slow...
O(N*log N)!
THIS IS ABSOLUTELY NOT A BEST PRACTICE!
Clever? Maybe, but not best practice!
Nice, it takes off the decimal and checks it aginst the actual case. Cool solution!
thank you!
The vector is passed by value. It is a copy so it won't affect the original one
I'm not sure if we should be changing the array itself. Seems like a bad idea even though it saves typing time.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
He's checking to see if the sqrt() function has decimals by comparing the base sqrt(n) to the rounded down version (floor()) of sqrt(n). If they are equal and the function returns true, then sqrt(n) must have no decimals. Thus, n is a perfect square.
You really want sort over 99999 elements only for find minimum?
why are you using floor specifically?
floor in C++
Loading more items...