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.
"n" means you are in trouble because you cannot solve it normally (like two "for" cycles and here we go) and you need to create something different.
This comment is hidden because it contains spoiler information about the solution
not a 7 kyu at all.
I've got TLE, what a great feeling!
Thank you for not letting people to solve it in O(n^2).
This comment is hidden because it contains spoiler information about the solution
It's strange that JS and Java versions should use different regex in special symbols.
Hey there!
For those who are struggling with random tests:
Please consider using console.log(word) inside your function to be able to see the agruments in the console.
Cheers ;)
Good kata, appreciate it, thanks!
Yeah, thanks, it's a good idea.
Now I need to figure out how to do it, because the only different part is ".replace(/7/g, 1)".
Well, I do not know what to say, we need more time for feedbacks.
A good one, like.
ParanoidUser, someday I will write it like you, but today I need to google it again.
Thanks!
Is that all or we have a third part? Kinda start loving it =)
Hi, to be honest with you the explanation is not too great. I have spent a lot of time just to calculate the wrong answers. It's not about creating an algorithm, but I was frustrated to understand how to get right amount of 'i's.
The approach when you are counting them as an idiot is a wrong one and all this kata depends on the idea that we need to find two things in an array and to subtract and divide them.
You draw there an image and my first idea was to calculate the 'i's between them, but this approach frustrated me, because it is not too clear why the result is different.
Let's see this one: '-----------------Y--------F--------------'.
So, from my point of view it's kinda obvious that the distance between them should be between them, namely it's 8 dashes and 4 'i's, not 9 as a result (due to indexes) and 5 as 'i's. I am not going to shout through my friend, I will shout to him to get his attention.
That's why I got frustrated and I think I'm not the last one.
I think the idea of counting dashes is much more cooler than just subtract and divide.
benjaminzwhite, brilliant reply!
It's really not a 5 kyu, but thank you all for the free points =)
Loading more items...