Ad
  • Default User Avatar

    I like my pasta with hard shells and extra cheese, you know, for that squishy chewy gooey effect. It should also be a little wriggly, to really enhance the textures... Yum!

  • Default User Avatar

    Wondering if it has something to do with the number being at the start of the word, but that doesn't quite make sense

    But that's exactly it ;-) %[] only matches a non-empty sequence of characters. As soon as the match fails, sscanf() returns, without parsing the integer.

  • Default User Avatar

    you are iterating on an list with a foreach loop while modifying it at the same time, this is very rarely a good thing to do, as it results in code that is hard to understand and a high probability of bugs. in some scenarios, you effectively delete some elements before they have been looped on, e.g. consider:

    ["two2", "one1"] --> after the first iteration of your loop, this will be converted to ["two2", "two2"]. "one1" never gets iterated on.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar
    • Be careful with strncpy(), it is a terrible function. It does not nul-terminate dest if there is no nul byte among the first n bytes of src. As a result ordered is not nul-terminated in your code
    • your code does not work for e.g. "1 4 3 2 5"
  • Default User Avatar

    I dont know what I'm Doing HAHAHAH

  • Default User Avatar

    Even with everything commented out, I get the following error when I press the Test button.

    Traceback (most recent call last):
      File "/workspace/default/tests.py", line 3, in <module>
    Test.assert_equals(order("is2 Thi1s T4est 3a"), "Thi1s is2 3a T4est")
    ^^^^
    NameError: name 'Test' is not defined. Did you mean: 'test'?
    
  • Custom User Avatar

    Approved

  • Custom User Avatar
  • Custom User Avatar

    Not a kata suggestion ! ^^

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    don't try to do it in a fancy way you can do it with just basics
    actually if you see my code I may look like dumb people

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    It is your code that throws this error. Don't forget to look at the stack trace in cases like this:

    System.FormatException : Input string was not in a correct format.
     at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
     at System.Int32.Parse(String s)
     at Kata.Order(String words)
     at Solution.SolutionTest.SampleTest()
    
  • Loading more items...