Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • Need a test like ['xyz', 'abc', 'xyz']
    My solution passed all the current tests, but it wouldn't have passed this one.

  • I still don't think the instructions are clear (as of May 2020). dlcoe's explanation of the sorting/rotating through each string being first in the order makes more sense, but is not included in the main Kata description. Also, the method of sorting the result array is not clear - I had to re-read the problem about 10 times before I understood that the result array is arranged simply based on the original, unsorted input array, which is counter-intuitive given how many times you are asked to sort the input array within the main body of the problem. Finally, in the example you show "1234" as being at the top of the first list (top left), which, if the sorting/rotating through each string being first described by dlcoe is correct, then 1234 should be the at the top of the last list (bottom right).

  • Thnak you, i've changed the description, better late then never :)

  • I think the description should to say "if array.Length == 0 return null" as from some point of view it can be treated as a square...which size is 0 ;p

  • Thank you for your interest :)
    I think everything is clear except diagonal way. I made a change about it.

  • This kata is harder than a 6 because of the requirement that we must sort the input alphabetically and then sort back into the default order, while the original can have duplicates.
    This Kata doesnt have much of an explanation, and is mostly an excercise in figuring out what we are supposed to do based on the examples.

    It would be a much better kata if there was some sort of real life analogy or situation. I cannot think of any way that would make sense with the duplicates and re-sorting.

    The description should probably state this additional information:
    Sort the strings in alphabetical order.
    Rotate through each of the strings being the first, while keeping the strings in the sorted order.
    Find the diagonal from upper left to lower right.
    We need to find the diagonal rotating through each of the strings being the first string.

    For the first test, the very first array diagnol expected back in your answer array is:
    abcd
    kata
    qwer
    1234 -> abcd => "aae4"

    That order looks quite arbitrary to me without explanation of the rotation.

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

  • Although some people just hardcode the answer when they can't get it to work only in 1 case, so random tests with duplicated would be nice too.

  • Looks good.

  • I got it now. Yeah, you are right, string[] test = new string[] { "abcd", "kata", "abcd", "qwer" }; input should return string[] expected = new string[] { "abtr", "kwcd", "aaed", "qbca" }; output. Thank you for your interest... I've reorganized my code and tests. Can you check again.

  • I don't see any such tests. Something like string[] test = new string[] { "abcd", "kata", "abcd", "qwer" };. What should be returned in this case? It's not really specified, but if it's a valid case, then I suppose the sort should be stable so that the first "abcd" comes first in the result, so string[] expected = new string[] { "abtr", "kwcd", "aaed", "qbca" };.

  • I've done. Can you check again?

  • Loading more items...