Ad
  • Default User Avatar

    I couldn't get console.write to work when it was timing out.

  • Default User Avatar

    without seeing the test input

    You could have printed it.

  • Default User Avatar

    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.

  • Default User Avatar

    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.

    if (str == null) {
      return string.Empty;
    }
    
  • Default User Avatar

    There's a published JS version which doesn't match the kata's spec. You may incidentally published it. To fix it: Go to kata edit page, remove the JS version and republish the kata.

    Regards,

    suic

  • Custom User Avatar

    Kata must be an at least 200% identical to be considered a duplicate

    That's not how it works. There're numerous katas asking you to either reverse a string, or make it titlecase. Creating a kata about doing both is a bad idea.

  • Default User Avatar

    I'm sorry, I don't understand what you mean.

  • Default User Avatar

    Hi Suic,

    Thank-you for your input.

    1. I have fixed the order of the arguments.
    2. I have added random tests.
    3. I have made the description less ambiguous.
      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.
  • Custom User Avatar

    Dummy JS version.

  • Default User Avatar

    Issues:

    1. Arguments in Assert.AreEqual are in reverse order.
    2. No random tests
    3. The description doesn't specify that the reversed names should be in title case. Therefore, "The reversed names must begin with a capital letter." can be interpreted like this "Tom" => "MoT".

    IMO this is also a duplicate. I solved many similar katas. The pattern for solving this is quite common in Python.

    Regards,

    suic

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    C translation kumited

    please scrutinize for approval

  • Default User Avatar

    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.