Ad
  • Custom User Avatar

    I was able to figure out the random tests were failing because I was destructively modifying the given strings. I duplicated them at the beginning and it solved the problem.

  • Custom User Avatar

    How do you explain that 174 guys passed the Ruby kata and 1832 in all languages? Algorithms are the same in all languages.

  • Custom User Avatar

    Sorting was Hard, took my time to figure out what type of sorting was required.
    Also achieved to solve it for "N" strings instead of 2 only.

  • Custom User Avatar

    RUBY

    I agree that the sorting is unclear in the instructions, but I was able to figure it out after trial and error.

    However, I am PRETTY sure the expected answers to the mix random tests are different than how the instructions state they should be.

    String1:
    Chjha9ftobRkhas@omzx3auefJnvgd
    The f count in string1 is 2

    String2:
    Srmrv;xobs-cgbnWgpifRxhef,uxfl
    The f count in string2 is 3

    Expected: "1:fffff/1:hhhh/1:xxxx/1:aaa/1:bbb/1:ggg/1:ooo/1:ee/1:mm/1:nn/1:ss/1:uu/1:vv/=:rr",
    instead got: "1:aaa/1:hhh/2:fff/2:xxx/1:oo/2:bb/2:gg/2:rr"

    The random test expects string 1 to have 5 f's but it only has 3.
    It is adding the total amount of f's and attributing it to the first string.

    Additionally, the expected strings are always prefixed with 1 or =. It never calculates the maximum letter count to be in the second string.
    Examples:

    Expected: "1:eeeeee/1:ffff/1:jjjj/1:llll/1:ddd/1:ttt/1:xxx/1:cc/1:pp/1:ss/1:zz/=:kk/=:ww",

    Expected: "1:vvvvvv/1:eeee/1:bbb/1:ggg/1:ppp/1:zzz/1:dd/1:ff/1:ll/1:rr/1:tt/1:ww/1:xx/=:aa/=:cc/=:mm/=:qq"

    Expected: "1:ddddddd/1:hhhh/=:aaaa/1:lll/1:ooo/1:qqq/1:xxx/1:bb/1:cc/1:gg/1:ww/=:rr/=:ss"

    The example tests are consistent with the instructions and I was able to pass them.