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.
I managed and I am very happy!
I am the number 25!(in Java)
Thanks :)
This comment is hidden because it contains spoiler information about the solution
aaah ... I found the guilty man of my tonight's(useless) optimization night :D
(Deleted!)
( This comment makes no sense, since I completed the Kata. Deleted!)
Dear Sensei,
somehow I managed to pass all the Tests ... but I was not really happy with my solution.
Yours and Voile's solution are wayy better than mine.
But that's exactly the reason why I am here, to learn from the best and improve( and to train myself for the Google's interview, but that's a different story :D ).
Looking forward to challenge myself with new Katas :)
KChallenge
Dear Sensei myjinxin2015, I am trying to solve this Kata because I didn't manage so far to solve the bigger brother https://www.codewars.com/kata/the-position-of-a-digital-string-in-a-infinite-digital-string( my Algorithm isn't fast enough), and you said in a comment this could be a preparation for that one. About this one: I developed some very complex Algorithm to compose multiple combination of numbers starting from the source string( for example, scan the string from the first char to the last, create blocks, check if the string composed by blockN + blockN+1 contains the input string). By now, I don't manage to cover all the tests, I pass circa 90% of them.
For example I fail in this one:
n = 37518333
I get "3337518" in place of "1833375" because somehow my Algorithm fail in composing this particular combination of numbers.
Btw, I don't want to bore you.
My question: could you give me some suggestion to solve this one? For example: I am thinking in the right way, this block composition strategy stuff? Or I am completely in a wrong way?
PS: I know that I could brute-force this very easily with a simple for. But I don't want to bruteforce it. I want to solve it in a smart way.
Thanks a lot :)
Wonderful Kata! I managed to implement a correct algorithm but ... it takes way much more than 16 seconds to execute!
Just as an example, this test "555899959741198" must give a result of "1686722738828503" ... that's a huge number, just only to iterate.
I have to figure out something to make it super efficient, otherwise I will never manage to stay within the 16 seconds!
Thanks for this Kata ... I hope I will manage to make it.
This comment is hidden because it contains spoiler information about the solution
This is very tough ... I am getting mad. Am I supposed to use reflection?
Very interesting Kata to develop the Java 8 skills( e.g. train with Streams) ... but honestly, I wouldn't have rated it L3. It took me like ... 20 minutes, maybe 25.