• Custom User Avatar

    This is, at most, a slight annoyance in the description. It is easy enough to figure out from the rest of the description and the test cases that your solution can't assume that the key length is the same as the text to encode or decode.

  • Custom User Avatar

    You misterpreted the description.
    The key IS repeated throughout the message, but you don't need to make them the same length.
    A little bit of modulo math.. et voíla!

  • Custom User Avatar

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

  • Custom User Avatar

    my bad, for anyone who might need this, this is th actual input for 8! (in js at least)

    08>:1-:v v *_$.@ \n ^ _$>\\:^

  • Custom User Avatar

    having trouble with 8! this is the input:

    08>:1-:v v *_$.@

    ^ _$>:^

    with these insrtuctions i get the following stack:

    [0,8,7,6,5,4,3,2,1]

    then it starts multiplying so it turns into

    [0,40320]

    with the last multiplication erasing the result

    [0]

    is this supposed to be working differently than this?

  • Custom User Avatar

    Description is misleading. It says Assume the key is repeated for the length of the text, character by character.. They are not, don't assume that. YOU need to make them the same length.

  • Custom User Avatar

    just to clarify for posterity, alphabetically means based on the first or each subsequent letter.
    so 1003 comes before 22 because it starts with 1 as opposed to 2 for 22.

  • Custom User Avatar

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

  • Custom User Avatar

    sample test says...

    orderWeight("2000 10003 1234000 44444444 9999 11 11 22 123") // → "11 11 2000 10003 22 123 1234000 44444444 9999"
    

    but in js, 22 as a string comes before 10003 as a string. Am I in the wrong here?