Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I have solved it.
BUT its no way kyu 7, its kyu 6 or 5.
Given initial array
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 afterwrri
becauseri
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.
Random tests break if input is modified from user code.
Reference solution is obviously wrong: it rejects any keys that contain the pattern
AbbA
if bothAb
andbA
are in the input list.'alr approved some time ago'
'alr approved some time ago'
This comment is hidden because it contains spoiler information about the solution
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.
Node's sorting is already stable since v7.0.
Just disable v6 and it should be fine I think?
The reference solution as used in the random tests uses the native JS
[].sort
, which is unstable. That meansis 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.
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.
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.
Why is the return type a string of an array of ints joined together? Can't you just let us return the array?
Example is not a replacement of a clear definition. Please provide a definition that can actually be understood.
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...