Ad
  • Default User Avatar

    The hardest parts seem to (0) understand the problem in a meaningful way, (1) to optimize the solution so long that it passes all tests without timeout.

  • Custom User Avatar

    Yeah, because I'm self-study, so it makes me surprise

  • Custom User Avatar

    Please use spoiler flag next time.

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    You're totally right in all that you said. I'm gonna fixe it soon, but right now I can't. Thanks for the critical comments.

  • Custom User Avatar

    your kata is just uncompletable, for now x(

    [[2, 3], [3, 4], [6, 2], [0, 9], [1, 0]]
    [[[2, 3]], [[3, 4]], [[6, 2]], [[0, 9]], [[1, 0]]] should equal [[[1, 0]], [[6, 2]], [[2, 3]], [[3, 4]], [[0, 9]]]
    

    the order of the output is related neither to sorting nor to the order of the points in the input. How exactly do you expect us to solve the task??

  • Custom User Avatar
    • your tests are almost always only isolated points. There is no... point (!) in doing so: you're testing thousand of times the very same situation.
    • inputs of the fixed tests are way too big. => 3-4 groups of 1-5 points each is way more than enough to test for proper situations. => aim for 15 points/test, NOT 50...
  • Custom User Avatar

    Hi,

    the setup of your kata is currently pretty inappropriate:

    • points should ideally be tuples
    • if you just want to identify groups, the output should be a list (or a tuple) of sets of points (hence tuples!), and absolutely not a list of list.
    • "very ideally", the output should actually even be a set of frozensets of tuples, otherwise...:
    • you didn't specify the rules for the ordering of the output. Without that, valid approaches cannot pass the tests while consistent with the current requirements: [[[8, 3]], [[0, 4]], [[18, 11]], [[1, 0]]] should equal [[[1, 0]], [[8, 3]], [[0, 4]], [[18, 11]]]

    if the order doesn't matter and you keep sequenced data types in the output, you'll have to sort them on your side before doing the assertions, meaning that you'll need a dedicated test method.

    • you didn't say in the description if all points are unique or not in the input.
  • Custom User Avatar

    I can see them, you probably need to click reset.

  • Custom User Avatar

    I added this sample cases where said Example Test Cases and save it of course, but when I try to solve it to see if the sample cases are loaded well doesn't load it. It show me the all code that I had.

    points = [[1, 1], [2, 1], [2, 2], [1, 3]]
    result = [[[1, 1], [2, 1], [2, 2]], [[1, 3]]]
    
    points0 = [[2,3],[3,4],[6,2],[0,9],[1,0]]
    result0 = [[[1, 0]], [[6, 2]], [[2, 3]], [[3, 4]], [[0, 9]]]
    points1 = [[8,3],[0,4],[18,11],[1,0]]
    result1 = [[[1, 0]], [[8, 3]], [[0, 4]], [[18, 11]]]
    points2 = [[2,-4],[4,-2],[-1,9],[14,12]]
    result2 = [[[2, -4]], [[4, -2]], [[-1, 9]], [[14, 12]]]
    
    
    Test.assert_equals(group(points), result)
    Test.assert_equals(group(points0), result0)
    Test.assert_equals(group(points1), result1)
    Test.assert_equals(group(points2), result2)
    
  • Custom User Avatar

    Please add actual tests in the sample tests ;) After that, feel free to republish this.

  • Custom User Avatar
  • Custom User Avatar

    Thanks for the feedbacks

  • Custom User Avatar
  • Loading more items...