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.
Hello, thank you for the Java translation. I would like to approve your work, but I get the error message "Description cannot be approved, recent changes from related record must be merged first."
Is it because of the changed description? How can I accept the changed description?
hi, sorry for the massive delay. can you add the new sample test changes for string ops? this looks good for a merge otherwise.
//TODO
can be removed from full test suite.null
or empty string) to make the setup compile.Approved
1
,-1
,Integer.MAX_VALUE
and something likeInteger.MIN_VALUE + x
.Random
class with proper API. No need for JS-yMath.random()*a+b
.Nice job! i solved it in a similar way.
Hi.
I made a change to ensure that an error of 1E-10 or less is considered valid.
There was a small chance that it would not pass in the tests or your solution.
instead of:
I made these small changes because there were times when, even though the square roots were in the same direction in both cases, the test didn't match those roots within the margin of error and gave a slightly different result. This change fixes that, and in 100000 tests performed, there is consistency.
Best regards.
Why do I think that's not 6 kyu? I think it is 4kyu.
Elegant solution, me likes this
I just edited it myself and also updated to JUnit 5.
@both: I would leave out the message in
assertEquals
. If it's otherwise ok, I'll approve it.Unfortunately, yes. Naming of so-called "functional interfaces" in Java is somewhat messy when compared to other languages.
BiFunction<T,U,R>
is a library type and something what could be described asT -> U -> R
.It can, it's called a method reference and is written as
Math::pow
.Can you do more with library or predefined functions vs. lambdas, as shown in the JS and Python description examples?
Another point of this kata is showing the equivalence of functions and lambdas.
I don't love all the
(a, b) -> Math.pow(a, b)
. Can't Java handleMath.pow
instead? Pointfree is good sometimes, and one of the points of the kata.Loading more items...