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.
Well, I got the answer but it took me a bit of time to understand why my answer is right :P
The 10 chair example wasn't enough so I used that to visualize the answer for 1 chair, 2 chairs, 3 chairs, 4 chairs, 5 chairs.
Using the given rules, a pattern comes about and that was it.
For me the most difficult part was trying to understand the description.
The descriptions should be simple, something like:
This comment is hidden because it contains spoiler information about the solution
For the given conditions, wasn't 6 kyu at all.
But fun none-the-less.
Thanks :)
Finally! After refining my logic multiple times, I ended up with my initial solution but with a very small change which reduced my execution time dramatcially!
In the end, I really enjoyed this kata.
Thanks for sharing :)
My logarithm base is a bit weak. Could you please explain how you got to this solution?
It would look like:
Thanks, still took awhile to figure.
For others, another example would be:
[1, 5] are in the same "clan" because they exhibit similar individual "feelings" to the same "group" of divisors.
The rest are in their own "clan" because they don't share the same individual polarity.
Kinda like, say when there are 2 judges:
I am finding it difficult to understand this kata.
Can someone please explain how 2 numbers can be friends here?
This kata showed me the difference in speed between a
for-in
and afor-each
(Swift).(0...n).forEach()
was much slower thanfor i in (0...n)
All I had to do was use the latter to drop to approx 8500ms; still can be optimized but darn it, a time-out on the solution is more frustrating :D
Thanks for this kata :)
This comment is hidden because it contains spoiler information about the solution
TDD blows my mind sometimes! This solution came in, like, a snap and I was like wtf!?
But now that I think about it, it makes so much sense!
Requires random tests
This was a fun kata.
Thanks :)
PS: Looks like most have done a brute-force to eliminate only one
!
at a time.This was fun. However, out of all katas I have seen so far, this one seriously needs some random tests.
Also, this felt more like a 6 kyu rather than a 5 kyu.
Loading more items...