Ad
  • Custom User Avatar

    .

  • Custom User Avatar

    First sort the string alphabetically (so a normal sort) and after that sort it again according to the sum of the digits.

    Running sort twice is unnecessary (it can be done sorting only once, with non-trivial comparer), and also requires the sorting algorithm to be stable. Not all implementations of sort are guaranteed to be stable.

  • Custom User Avatar

    (assuming a stable sort is used)

  • Custom User Avatar

    First sort the string alphabetically (so a normal sort) and after that sort it again according to the sum of the digits.

  • Custom User Avatar

    No I said the opposite of that. I said I think you are already familiar with it.
    You already had all the answers, and yet weren't seeing it. I don't know why that is, but all I can do is point at where you have the answer.

    I can also ignore that you already have the answer and instead repeat it. I'm aware this is often more appreciated. But I kind of refuse to do that as the method of figuring things out is more important than the answer.

  • Custom User Avatar

    Your quote says what to consider after weight so you shouldn't be considering

    and it occures before both 11's.

    I suspect you're familiar with alphabetical ordering. Which comes first, zebra or armadillo?

  • Custom User Avatar

    Yes this normal. There are a small number of test case. Your code may simply miss possibilities not included in the tesrs. For example in this kata the test cases do not include any two digit numbers. This could cause an error in your code if you build a string and then try to use join (Python). I made this error in my first attempt.

  • Custom User Avatar