Ad
  • Custom User 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!!

  • Custom User Avatar

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

  • Custom User Avatar

    Objects need to be hashable. Unless one goes with custom types, tuples and frozensets are all that you can get (about iterables other than strings, I mean).

  • Custom User Avatar

    Yes, though a bit of a pitty you limit yourself to these types.

  • Custom User Avatar

    You are absolutely right, that's my bad. I changed the description. Does it sound okay now?

  • Custom User 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.

  • Custom User Avatar

    Thank you!

  • Custom User Avatar
  • Custom User Avatar

    yes.

    (Note : you should remove the commented out line in generate_random_test)

  • Custom User Avatar

    Should be fixed now. Did I make it correctly?

  • Custom User Avatar

    Oh, I got it, sorry. I will change it now

  • Custom User Avatar

    Hi! I am not sure why it shows up like that. For me, it shows as ` result1 = check_unique(arr)

            test.assert_equals(result1,check_unique_check(arr))
    

    ` Is it the right way? Or I am not following it?

  • Custom User 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)
    
  • Custom User Avatar

    (you need to publish again, to "undraft" it again)

  • Custom User Avatar

    Fixed

  • Loading more items...