6 kyu

Unique sets

Description
Loading description...
Lists
Arrays
Sets
  • Please sign in or sign up to leave a comment.
  • Unnamed Avatar

    How is it different from any other kata about flattening collections?

    • dfhwze Avatar

      This comment has been hidden.

    • DrillToHeaven Avatar

      I understand your point. Thank you for your feedback! I'm considering updating the challenge to incorporate all hashable compound types, such as named tuples and custom-created iterable hashable objects, to ensure that the task is even more authentic. May I ask, if this would resolve the issue? Please, let me know your thoughts!!

    • Blind4Basics Avatar
      • namedtuples are just tuples. You can add them, but that won't change a thing.
      • introducing custom types is imo a bad idea, because it will just transform the task into a hassle, because the rules to identify them will most likely become messy. That or you provide a clear spec of how to identify them, and the task goes back to what it currently is. Like, exactly.
    • DrillToHeaven Avatar

      I see. Then if you believe this kata doesn't add value to the community, please let me know and I'll remove it (or vote it down). On the other hand, if you think the idea is beneficial, then I’d be happy to keep it and refine it further based on your feedback!

    • Blind4Basics Avatar

      I personnaly am fine with it. As dfhwze pointed out, the way the task is described is enough of a twist to me.

  • dfhwze Avatar

    You talk about Such as tuples or frozensets,. Does that mean there can also be other types of Iterables? It matters, since several solutions just hardcode the types you suggested. This should definately be clarified in the description.

  • Blind4Basics Avatar

    oh, but you wrote the code "backward" in the random tests.

    1. Generate the array
    2. Start the @test.it block
    3. Compute the expected value <<<<
    4. Call the user's function

    Hence:

            expected = check_unique_check(arr)          
            test.assert_equals(check_unique(arr), expected)
    
  • Blind4Basics Avatar

    Hi,

    • The fixed tests (sample tests+full test suite) should contain cases that are specific to one single rule. Currently, there are no tests that are testing specifically for the overlapping rule in the same test, because if the user forget that part, the 6 is common to two different sets.
    • In the random tests, you don't need to send a copy to the ref solution, as longas the user gets a (deep) copy.
    • In the random tests, the call to the user's function has to be inside the @test.it block

    cheers

  • mauro-1 Avatar

    There are 5-10 random tests that expect True even if there are duplicate values, e.g.:

    Testing random case: [{'lnic', frozenset({'yxcit', 'grk', frozenset({73, 'etglon', 7}), 'bjg'})}, {(52,), 7, 79, frozenset({75, ('bvfja', 84, 'geoa'), 'ngiku', frozenset({'ozscm', 'oqn', 'vxk'})})}]
    False should equal True                                                            ^                      ^
                                                                                       |                      |