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 couldn't get console.write to work when it was timing out.
For C# (and possibly the tests for other languages), your code needs to be able to handle prime numbers up to 1 million. I think it would have been helpful to have this information included in the question, as I kept timing out and without seeing the test input I couldn't work out why.
I had this problem as well. I have never had to test for null when the parameter is typed string in any other katas. I think this is an error in the kata. I added this code to mine to fix it.
I'm sorry, I don't understand what you mean.
Hi Suic,
Thank-you for your input.
I searched for other katas and did not find any that were exactly the same. Although there are other katas involving reversing strings, I could not find any that required the reversed strings to be in title case.
I agree that this is a problem. I did the problem in C#. I am fairly confident my original solution was correct, but it was failing a test. After seeing this comment I 'fixed' my solution by subtracting a year from my loop and it works. The issue is with the Random Test, unfortunately without knowing what values are used it is impossible for me to show you mathematically what is wrong with the test. However, if you have a look at the solution I have submitted, you can see how I am looping for 1 less year than I should be.
Just solved this one, its definitely the hardest one I've done so far! The trickiest part to implement is '[' and ']' commands. If you are using Array.FindIndex('[') or something similar you are doing it wrong. You need to pair the brackets, like how brackets are paired when writing code. For example in
,[.[-],]
the first[
pairs with the last]
. Also, remember to be really careful about whether you are changing the data pointer or the instruction pointer, it's easy to make a mistake! I found the output from the second test to be confusing, however the issue I had with passing the 2nd test was also picked up by the 3rd test. I am not sure how much memory is needed for the test cases, but when I submitted mine I used a byte array of 10000. However, for the the 3 sample problems, I can pass them using a byte array of size 100.I think a lot of people in this discussion are overthinking the problem. You can use the time for each block to work out how many blocks the walk should be (HINT: All walks will be the same number of blocks). The walk must return to the same point as the walk started. A walk that takes 8min, but finishes a 2min walk away from start would be invalid. A 6min walk that finishes at the starting point would also be invalid. Lastly, walks don't need to be sensible, like in a loop or anything. A walk that was just north, south repeated 5 times would be valid. You are just checking that the walk is the correct length, and the end location is the same as the start. I did it in C#, so I can't say whether the tests for other languages are the same though.