Ad
  • Custom User Avatar

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

  • Default User Avatar

    clean, but the intital split/filter repetition seems a bit high in performance cost and very reduceable.

  • Default User Avatar

    It seems that everybody solving this question gets stuck on the ordering after getting 90% done with the kata (even me). the sort order is sorted lastly alphabetically.

    If you're at that point; take a step back and clear your head and then you'll get it.

    Good Kata.

  • Custom User Avatar

    No, you're wrong there, there is no Reverse Lexicographical Order:

    in decreasing order of their length and when they have the same length sorted in ascending lexicographic order

    You sort them by length, from longer to shorter, and when they have the same length, you use the default sorting for strings (ascending) in the language you use.

  • Default User Avatar

    Nevermind. I''m going to try it one more time and come back to this question.

  • Default User Avatar

    Sorry. I forgot the code point reference. That solution isn't viable for the tests after. (updated in original question.)

  • Custom User Avatar

    In that test, both h and r has the same prefix, y has a prefix of 2 and that's why that substring comes before the ones with =, please read what I answered to your post.

  • Default User Avatar

    but 'y' isn't before 'h' or 'r' Alphabetically.

    And a later test mixes '1' '2' and '=' as meaningless to the order.

  • Custom User Avatar

    In the result, substrings (a substring is for example 2:nnnnn or 1:hhh; it contains the prefix)

    2 comes before =. You can see that in the last example:

    s1="Are the kids at home? aaaaa fffff"
    s2="Yes they are here! aaaaa fffff"
    mix(s1, s2) --> "=:aaaaaa/2:eeeee/=:fffff/1:tt/2:rr/=:hh"
    
  • Default User Avatar

    {"Are they here", "yes, they are here"} should return {"2:eeeee/2:yy/=:hh/=:rr"}

    I think there is a pattern here that I'm not fully aware of because "Lexographic Order" means "Alphabetical"; but I assume you mean "In the order it appears in the strings."

    However; 'h' and 'r' both appear before 'y'; if I assume that I'm ordering based on the reverse of one of the strings. AND 'r' appears before 'h' if I assume Min(appearance_order).

    Is this puzzle saying that we should order the output based on the forward order of the second string AND THEN the forward order of the first string? If so "Reverse Lexographic Order" is slightly misleading.

    (Edits are fixing grammar, typos, and word choices)

    Edit: A later test mixes 1,2 and = prefixes in an uncertain order; which means that there is an order of operations assumed in the final solution that isn't offered in the problem statement itself. If you're assuming a different type of ordering based on which part of the process you're in; it should be clarified.

    This assumption is made by "Code Point Order" being said after "Reverse Lexigraphic Order".

    Which means you're assuming that there is a particular design pattern that should be used here; despite not referencing it or allowing for the users to solve the problem as written.

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

  • Custom User Avatar

    Confirming this is an issue.

    https://www.codewars.com/kumite/65b82df297eea3ca1acfb34e

    ^ Fork fixing the issue

  • Default User Avatar

    in JavaScript: test doesn't check if is formatted to two decimal places, despite it stating the requirement in the description.

  • Default User Avatar

    i dont understand whats going here...

  • Loading more items...