Ad
  • Custom User Avatar

    Should have explain better on this seriously, "come before" can be understand as stand before as place in the string, so "2000" start with "2" and "11" start with "1", if sort by string then become "11 2000"

  • Custom User Avatar

    I agree. Not worded very well. I interpreted to be which string came first in the input, not alphanumerically as Lazy Wolf states correctly.

  • Custom User Avatar

    me too. the same weight ,how to order it?

  • Custom User Avatar

    I have to agree, this was one of the most poorly explained Kata's :( i parsed the string as an integer to compare.

  • Custom User Avatar

    @g964

    Please link LazyWolf's explanation to how string comparison works, all of us come from different skill levels and may never have come across this concept

  • Default User Avatar

    Look also at how one compares (puts in order) strings.

  • Custom User Avatar

    I understand you mean something else by string now based on your example.
    I am using Java for this kata.
    I will go look at what strings are in the Java Docs then -> https://docs.oracle.com/javase/7/docs/api/java/lang/String.html

    Documentation doesn't mention how to compare but I found Lazy Wolf's explanation at the bottom.

  • Default User Avatar

    You wrote yourself:

    Okay, but the instructions are: "When two numbers have the same "weight", let us class them as if they were strings"

    As a string (and also as a number) "11" comes before "2000".

    But you should have maybe a look at what strings are in the language you are using at CW (Ruby, Python, ..., ?).

  • Custom User Avatar

    I'm sorry I don't understand, what do you mean by string?
    Do you mean the input String "strng" in the kata?
    If a string contains ("2 1"), then "2" is before "1".
    If a string contains ("1 2"), then "1" is before "2".
    That's how I understand it, am I wrong?

    I agree 11<2000 but the instructions don't mention to sort by ascending order of numerical value. Is that what you mean?

  • Default User Avatar

    Is "1"before of after "2" as string? "11" < "2000" => true, no?

  • Custom User Avatar

    Okay, but the instructions are: "When two numbers have the same "weight", let us class them as if they were strings"

    Does 2000 and 11 have the same weight (2)?

    Which comes first in the input string 2000 or 11?

  • Default User Avatar

    There are no error in the test.

  • Custom User Avatar

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