In the result, substrings will be in decreasing order of their length and when they have the same length sorted alphabetically (more precisely sorted by codepoint); the different groups will be separated by '/'.
Then why does the example expect 2:eeeee/2:yy/=:hh/=:rr and not 2:eeeee/2:yy/=:rr/=:hh. Code point of r is greater than h. Codepoint is the numeric code of char?
Added for JS
This comment is hidden because it contains spoiler information about the solution
bad solution.
Thanks! solved
The description says "in the result..." so yes you have to take account of the whole string.
I tryed to sort the strings with the same length alfabetically but does not match with the example:
'2:yy'
<'=:hh'
<'=:rr'
. I'm very confusedThen why does the example expect
2:eeeee/2:yy/=:hh/=:rr
and not2:eeeee/2:yy/=:rr/=:hh
. Code point ofr
is greater thanh
. Codepoint is the numeric code of char?There are many tests missing in the kata, the test failures do not have any descriptive message and the description of kata may be better.
My solution say that IP '1e0.1e0.1e0.1e0' is valid but it is not. It should exist a test that validates this.
This comment is hidden because it contains spoiler information about the solution
missing DRY
index is not necessary ;-)
eval is evil! ;-)
reverse isn't needed: http://www.codewars.com/kata/reviews/54245bec0d07e54d4600031b/groups/55b282f9a8454e7e23000038
Congratulations on implementing generic solution!