Ad
  • Custom User Avatar

    I have solved it.
    BUT its no way kyu 7, its kyu 6 or 5.

  • Custom User Avatar

    Given initial array

    [
      'KJ', 'JK', 'wr', 'Dk', 'N6', 'oU', 'Uo', 'sX',
      'Kc', 'cK', '5A', 'A5', 'xT', 'Tx', 'RO', 'OR',
      'yV', 'Vy', '8Q', 'qq', 'KM', 'MK', 'kQ', 'Qk',
      'Hy', 'yH', 'BQ', 'QB', 'jP', 'Pj', 'ZN', 'wI',
      'Iw', 'Yo', 'oY', 'EO', 'Yx', 'xY', 'cJ', 'Jc',
      'yr', 'ry', 'fe', 'ef', 'll', 'll', 'Hq', 'U5',
      'g3', '3g', 'BB', 'yN', 'Ny', 'A0', '0A', 'Nv',
      'aR', 'Ra', 'Po', 'oP', 'ab', 'p2', '2p', 'wd',
      'dw', 'Ev', 'vE', 'pm', 'ir', 'ri'
    ]
    

    The first entry of the reference solution is {"wr":["wrriirryyVVyyHHyyNN6","wrriirryyVVyyHHyyNNvvEEOORRaab"]}. This doesn't satisfy the rule that chains in each of resulting array's element's value should respect initial array's elements order. You can't continue the chain after wrri because ri is the last element.

    Also, I would expect the solution to start with {"KJ":["KJJc",...]}. But that's another issue.

    Please fix the solution or describe the problem better.

  • Custom User Avatar

    Random tests break if input is modified from user code.

  • Custom User Avatar

    Reference solution is obviously wrong: it rejects any keys that contain the pattern AbbA if both Ab and bA are in the input list.

  • Default User Avatar

    'alr approved some time ago'

  • Default User Avatar

    'alr approved some time ago'

  • Default User Avatar

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

  • Custom User Avatar

    I had to make my sort stable to pass the example tests.

    I'm not debugging anything with the current random tests sized $RIDICULOUS, but I remain firmly unconvinced the problem is with my code.

    I am using Node v8.x.

  • Custom User Avatar

    The reference solution as used in the random tests uses the native JS [].sort, which is unstable.

    Node's sorting is already stable since v7.0.

    Just disable v6 and it should be fine I think?

  • Custom User Avatar

    The reference solution as used in the random tests uses the native JS [].sort, which is unstable. That means

    keep initial order of items of the same type

    is not guaranteed in the reference solution.

    I think I'm running into this: I pass the Example tests, I take great care to sort stably, I fail the Submit tests, but I cannot debug because I'm f***ing drowning in data.

    I'm not 100% sure this is a kata issue, but I'm marking it as such because I am 99.99% sure.

  • Custom User Avatar

    The Submit tests are useless for debugging because of sheer data overload.

    Include random tests of smaller samples as well, because not all bugs can be fixed by training on the Exemple tests.

  • Custom User Avatar

    The Sample Tests block in the actual tests are actually random tests, so it shouldn't be described as sample tests.

    Speaking of which, fixed tests should be added either.

  • Custom User Avatar

    Why is the return type a string of an array of ints joined together? Can't you just let us return the array?

  • Custom User Avatar

    Example is not a replacement of a clear definition. Please provide a definition that can actually be understood.

  • Default User Avatar

    Hi!

    ex: [
    { r: 1, t: 1, i: 1},
    { r: 1, t: 1, i: 2},
    { r: 1, t: 1, i: 3},
    { r: 1, t: 2, i: 4},
    { r: 1, t: 2, i: 5},
    { r: 1, t: 2, i: 6},
    { r: 1, t: 3, i: 7},
    { r: 1, t: 3, i: 8},
    { r: 1, t: 3, i: 9},
    { r: 1, t: 4, i: 10},
    { r: 1, t: 4, i: 11},
    { r: 1, t: 4, i: 12}
    ]

    sorted: [
    { r: 1, t: 1, i: 1 },
    { r: 1, t: 2, i: 4 },
    { r: 1, t: 3, i: 7 },
    { r: 1, t: 4, i: 10 },
    { r: 1, t: 1, i: 2 },
    { r: 1, t: 2, i: 5 },
    { r: 1, t: 3, i: 8 },
    { r: 1, t: 4, i: 11 },
    { r: 1, t: 1, i: 3 },
    { r: 1, t: 2, i: 6 },
    { r: 1, t: 3, i: 9 },
    { r: 1, t: 4, i: 12 }
    ]

    If you look at t, you'll see that there're 4 different types (1, 2, 3, 4) x3 of each, so they should be sorted as following 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4.
    If we mark each item of the same type by a letter, we will get (1a, 1b, 1c) and so on, and final sorting should look as following got types: 1a, 2a, 3a, 4a, 1b, 2b, 3b, 4b, 1c, 2c, 3c, 4c.

    output: '1:4:7:10:2:5:8:11:3:6:9:12';

  • Loading more items...