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.
+1 Clever Point for checking perfect squre differently than multiplying with the same number.
Very clear and simple solution!
( duplicate comment )
You're performing the Math.sqrt(sq) function twice, it would have been better to put that into a variable. Just to save yourself from calculating it twice. Clean solution though.
temporary issue of CW's servers, not an issue of the kata. Closing.
Thanks, I will check it
java
Help us help you. Tell us in which language you have this problem.
add a "s" behind the "play"
oh shit i missclicked XD
KISS XD
You say in description "returning a list of integer pairs" but you are returning array of arrays in Java.
really bad primes solution
You should provide more details on why adding String in loop is a bad practice (performance issue) and a solution (
StringBuilder
). I don't remember this kata but a Regex compiled in a loop plus aScanner
are overkill and even worse than a String adding. A better way is to usePattern
/Matcher
andparse...
function fromDouble
andInteger
.In any case this code is not a 'Best Practices', but a quick-and-dirty simple solution.
you should not add Strings in a loop
it does not generate infite number of primes
Loading more items...