Ad
  • Custom User Avatar
    • Description should be language-agnostic

    • Example tests on same data entry user with different scores should be added

  • Custom User Avatar

    People usually don't rewrite kata out of the blue.

  • Custom User Avatar

    I can see that this is ruby-exclusive kata.
    Why array of arrays? This was perfect opportunity for hashes :(

  • Default User Avatar

    Tests clarified.

  • Default User Avatar
  • Custom User Avatar

    Please, add a couple example tests and random tests.

  • Custom User Avatar
  • Custom User Avatar

    Instructions need clarification about the fields in the arrays.

  • Custom User Avatar

    The instructions on how the comparison should behave when grades are the same could be clearer.

  • Default User Avatar

    Ideas:
    You could specify: "if the same student has multiple scores saved, keep only the highest score" or some such.

  • Default User Avatar

    "Why should I favour [1,2] over [1,3]."

    Definitely agree here. There is no way to know which score should be stored for student 1 (when integers are used as names instead of strings). Please fix this. Otherwise a great little kata.

  • Custom User Avatar

    Description fails to prepare users for numerical usernames or for being passed duplicate usernames with marks that don't match. Why should I favour [1,2] over [1,3].

    Why should dataclean([['a',5],['b',3],['a',5]]) be [['b',3],['a',5]] while dataclean([['a',2],['b',3],['a',2]]) returns [['a',2],['b',3]] in a different order?

  • Default User Avatar

    Can you add a description of the user entries. There needs to be something about the last element of a user entry being the score, and, I believe, all other elements in a user entry describe the user (say, by name or ID).

    For formatting the example, I think wrapping it with triple ticks and including "ruby" right after the first triplet (see http://www.codewars.com/docs/description-markdown-field for examples) will do what you want:

    dataclean(nil) #returns nil
    dataclean([['a',5],['b',3],['a',5]]) # returns [['b',3],['a',5]]
    dataclean([['a',5],['a',5]]) # returns [['a',5]]
    dataclean([['a',2],['b',3],['a',2]]) # returns [['a',2],['b',3]]
    
  • Default User Avatar

    Thanks. I have made these changes.
    How do I format the Example?

  • Default User Avatar

    The following points need to be addressed in the description:

    • Describe the values argument. It seems to be an array of arrays, but may also be nil. Furthermore, it seems each array in the argument contains positive integers (although the examples given in the description have a string for the name/ID and an integer for the score) and is such that the first element is the student's name/ID and the last element is the score; for example, [[1,2,3],[2,1,4]] contains two students with the names/IDs of 1 and 2 and the corresponding scores of 3 and 4 (the middle element(s) may be ignored).
    • Mention the expectation that the method should return nil if the argument is nil. Are there any other cases where nil should be returned? If the argument is an empty array, then an empty array should be returned, correct?
    • If the entries (arrays) in the argument are allowed to contain a string for a name/ID and an integer for a score, should the duplicate testing be case-sensitive? That is, would ['a',2] and ['A',2] be duplicate entries?
    • The example section needs to be cleaned up so that each example is on its own line.