Ad
  • Default User Avatar

    .

  • Custom User Avatar

    In that case the fault is mine. I misunderstood you. Apologies

  • 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.

  • Default 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.

  • Default 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

    I appreciate that you tried to answer the question but assuming that I'm unfamiliar with the alphabet was completely unnecessary. I asked the question because I was confused not to learn the alphabet. You'd rather not answer the question than do so but make me feel dumb.

  • Default 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

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

  • 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.

  • Default User Avatar

    Got too honed in on a certain approach initially, then remembered the importance of simplicity

  • Default User Avatar

    This is one of those katas I thought was going to be easy, but then that last test comes up and I'm thinking this may be out of my league :( Congrats to everyone who has solved it thus far!

  • Custom User Avatar
  • Custom User Avatar

    Is it normal to pass the test but failed the attempt? I believe my solution works and it does pass the test how ever an error pops up when i try to 'attempt the question'

  • Custom User Avatar

    i am trying to solve this but am stuck at the point that the indexOf() method does not separately return the index of values that appear twice..is there any other possible way if i may ask