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.
cannot be changed anymore
right? i test it too. it not work with last test
Doesn't work for:
$this->assertEquals([], solution(""));
strlen counts ç,ş,ü,ğ as 2. so its better to use mb_strlen or convert it to an array then count.
Hi, as was mentioned in task description, we need iterate until Math::PI - our_calculated > epsilon. You may, possible getting your iterations count by some manipulations with epsilon itself - e.g. take reverse number of it, or so on.
You can use:
(r * 1e10).round / 1e10
where
r
is your result with all its decimals (as long as r is correct...).Hi,
I tried to solve this kata in Crystal. Unfortunately I have two issues:
expected: [10, 3.0418396189]
got: [10, 3.0418396186909367]
on the other hand using round 9 returns a value as expected:
expected: [10, 3.0418396189]
got: [10, 3.041839619]
It's just my third kata in Crystal, so I don't know if I'm doing something wrong or it's just a bug in Crystal
a) first test
expected: [10, 3.0418396189]
got: [10, 3.0418396186909367]
b) second test
expected: [100, 3.1315929036]
got: [100, 3.1315929033839542]
c) thrid test
expected: [1000, 3.1405926538]
got: [1000, 3.1405926539827576]
d) fourth test
expected: [10000, 3.1414926536]
got: [10000, 3.1414926533677505]
Any ideas?
Thanks in advance
This comment is hidden because it contains spoiler information about the solution
I liked this one as well. Interesting how everyone has solved it so far.
I agree with comments of Joshua B. Should be a higher grade Kata.
Definitely agree, spot on with your comments.
I was wondering if a 7th kyu grade is skilled enough to solve this kata this way, as it is a beginner's grade.
My expectation has been (from a java point of view):
8th kyu -> brute force solution with simple type int
7th kyu -> brute force solution with BigInteger (for I have to use the object's methods and constants)
6th kyu -> performing a bit-wise operation for enhancement
What do you think?
Why not adding a link to mathworld ( http://mathworld.wolfram.com/Determinant.html ) inside the kata description for some theory background about determinants?
Ah, I see. No problem, just would've been nice...err naughty...nevermind ;-)
Once a kata has 500 completions it becomes locked from edits.
Loading more items...